--- In [EMAIL PROTECTED], Alex Peters <[EMAIL PROTECTED]> wrote:
> --- Bruce wrote:
> 
> > And if the base requirements is to be able to persist the static
> > variables in a script, then my style would be to provide a
> > [EMAIL PROTECTED] entry point to be called to due that (along with a
> > [EMAIL PROTECTED] to unpersist). (BTW< I don't know why you would want 
to
> > persist locals).
> 
> I don't quite understand what you mean here�� would you mind
> explaining it, possibly with a script example?

; This scripts echoes last time it was called 
; and number of times called and 
; saves these values between PowerPro sessions if entrypoints
; save and load called from shutdown and startup

; Call at top to echo values and reset
static Num, Last
MessageBox("ok", Num++" "++Last, "Num Last")
Num= Num+1
Last = time
Quit

; Called here to save current values
; I save each variable in a separate file:  this works for any string

@save
static Num, Last
local folder = pprofolder++?"\scripts\"++scriptname++?"\"
local fname = folder ++ "num"
file.writeall(fname, Num)
fname = folder ++ "Last"
file.writeall(fname, Last)
quit


; Called here to load current values

@load
static Num, Last
local folder = pprofolder++?"\scripts\"++scriptname++?"\"

local fname = folder ++ "num"
if (validpath(fname)) do
   Num = file.readall(fname)
else 
   Num = 0
endif
fname = folder ++ "last"
if (validpath(fname)) do
   last = file.readall(fname)
else 
   last = 0
endif
quit






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to