initialize an static, local, script-wide variable to empty

Richard Gaskin ambassador at fourthworld.com
Tue Jul 15 16:20:00 EDT 2003


erik hansen wrote:

> --- Richard Gaskin <ambassador at fourthworld.com>
> wrote:
>> erik hansen wrote:
>> 
>>> 
>>> --- Richard Gaskin
>> <ambassador at fourthworld.com>
>>> wrote:
>>> 
>>>>> is there a way to set sHolder to
>>>>> empty between each use?
> 
>> No, you would need a handler to trigger it.
>> Otherwise, Rev wuldn't know
>> when you want it cleared.
> 
> i wanted a static-global like sHolder to empty
> itself between uses just to reduce the clutter.
> 
> local tHolder 
> in each handler does the job, of course.
> 
> in the script (ouside any handler) you can write
> local sHolder = 0 and this will put 0 into
> sHolder but i haven't found out whether sHolder
> resets to 0 after each use.

Scipr-local (or "static") vars retain their values during the current
session.  The exception is that editing a script will reset the value of
such vars defined in it.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list