texis properties defaults

Post Reply
amitic
Posts: 14
Joined: Fri Jul 02, 2010 10:57 pm

texis properties defaults

Post by amitic »

Is there a way to reset a texis property to it's default value?
Or maybe a way to query the currently set value?

Let's say, for example, I'd like to change the 'timezone' property temporarily and than reset it back to it's default (local) value - all within a single texis invocation (ie. inside a single vortex script).
Can this be done?

It appears that on windows "SET timezone = '';" or "SET timezone = null;" will reset the timezone property, but this does not work on linux installations.

Thanks
User avatar
John
Site Admin
Posts: 2597
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

texis properties defaults

Post by John »

On Linux (and should work with Windows too) you could do:

<syscp getenv TZ>
<$OrigTimezone=$ret>
<syscp setenv TZ $NewTimezone>
...
<syscp setenv TZ $OrigTimezone>
John Turnbull
Thunderstone Software
amitic
Posts: 14
Joined: Fri Jul 02, 2010 10:57 pm

texis properties defaults

Post by amitic »

Thank you, John.

This however only works on linux (at least it doesn't work on 5.01.1258488718/20091117 windows version).
I could combine the "set timezone" for windows and "syscp setenv" for linux after querying the current platform, but would still prefer a single approach that works on both platforms - if that is possible.

Regards
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

texis properties defaults

Post by mark »

Is you concern for resetting the value withing a single invocation or are you worried that the settings will stick across invocations such that one run will affect the next? The latter will not happen. Each run starts with default settings regardless of set commands issued by previous runs.
amitic
Posts: 14
Joined: Fri Jul 02, 2010 10:57 pm

texis properties defaults

Post by amitic »

I am aware that these settings are only in effect 'within' the single texis process instance.
What I need is to create a vortex function that doesn't alter the texis/vortex context of the caller in any way. Thus, I need to reset every change I make.

In this case (the timezone property) reseting it to it's default value (which is effectively the local system time zone) will suffice, although it would generally be nice to have the means of querying the value of a property before it's change and reseting it to this value at the end.

Regards
User avatar
John
Site Admin
Posts: 2597
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

texis properties defaults

Post by John »

You should be able to use the set timezone= instead of setenv on both:

<syscp getenv TZ>
<$OrigTimezone=$ret>
<sql "set timezone=$NewTimezone"></sql>
...

<sql "set timezone=$OrigTimezone"></sql>
John Turnbull
Thunderstone Software
Post Reply