[V4REV] again: why we have go by way of single stack ???

Ken Ray kray at sonsothunder.com
Wed Jun 15 14:40:32 CDT 2005


On 6/15/05 10:25 AM, "Ivan Smahin" <IvanSmahin at public.kherson.ua> wrote:

> Hello Robert,
> 
> Wednesday, June 15, 2005, 5:54:33 PM, you wrote:
> 
> 
> Thank you for the answer.
> 
> Is it true that
> 
> local var
> ...
> 
> will be accessible and has a "static" behavior in the particular
> script ( card script for example )?

Yes, so long as it is *outside* of all handlers, it becomes "script-local";
that is, avaialble to all handlers in the script. For example:

local sMyVar

on mouseUp
  put 10 into sMyVar
end mouseUp

on DoIt -- called from somewhere else
  answer sMyVar
  -- answers "10"
end DoIt

If you put the local *inside* of a handler, it is local only to that
specific handler.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com



More information about the Valentina-beta mailing list