EXPORT

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

EXPORT

Post by Thunderstone »



I have tried using the export function to no avail. I have a function that
modifies $myvar each time TEXIS is invoked, but it seems to get initialized
to zero every time instead of assuming the exported value. Is there
something special you have to do to make exported variables work?

<EXPORT $myvar QUERY USEROK>


-------------------------------------------------------
Travis Kerzic




User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

EXPORT

Post by Thunderstone »



http://www.thunderstone.com/vortexman/node32.html
says
.. Variables EXPORTed with the QUERY flag are saved to $urlq ...

So you have to print $urlq for them to actually get exported to the
next invocation.

Something like
<a href="$url/$urlq">...
or
<a href="$url/somefunc.html$urlq">...

Using any export type but QUERY will handle it fully automatically.




Texis User
Posts: 74
Joined: Thu Jul 13, 2006 8:47 am

EXPORT

Post by Texis User »

Hi,

How do you maintain state of a variable across scripts that are not invoke through web , but scheduled to run after 5 mins.

Also I have a script, that I have made it to run in infinite loop i.e. while(true).
This is scheduled to run every 30 mins.
When invoked it reads runlog gets the pid of last run/current running script. If there is some script running it exits.

Now inside this script I invoke submethods as seperate processes using <switch>.
I wanna keep track of these subprocesses i.e. only max_process can run at a time.

Since ps -ef |grep "string" doesnot work uing <exec nobr... I decided to have a variables that hold the count at anytime.

When a subprocess finishes it subtracts one and when starts add one.

I want these variables exported/ available for each subprocess and only one suprocess can edit the value.

Continuing forward I let the subprocess sleep if the count exceeds.

Any suggestions?

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

EXPORT

Post by John »

For both cases it sounds as if a table is the right way to do it, storing the values. You can use SQL to update and query, e.g.

<SQL "update subproc set num = num+1"></SQL>

and for the other variables:

<SQL ROW "select Name, Value from vars">
<setvar $Name $Value>
</SQL>
John Turnbull
Thunderstone Software
Post Reply