Re: local variable scopes

Scott Raney ((no email))
Thu, 2 Mar 1995 19:24:36 -0700 (MST)

>
> Hi fellow metacard developers...
>
> If I defined a local variable at the top of a card script (not inside a handler
> but on line 1) would it be known in lower-level object handlers, such as in
> fields or buttons found on this same card?

No, only within the handlers in the card script. A local declared
this way is roughly equivalent to a "static" variable in the C
language since it retains its value across handler invocations (like a
global variable), yet can't be seen by handlers in other scripts (like
a local).

For your purposes, you'll need to define a global variable. Just be
careful to give the global a unique name, possibly by prepending the
stack or card name to it.
Scott

> --Bruce
>
>
> --
> * Bruce G. Holm 503-685-1350 email: bruceh@wv.mentorg.com
> * Mentor Graphics Corp. 503-685-7000
> * 8005 SW Boeckman Rd.
> * Wilsonville, OR 97070-7777 Disclaimer: Opinions expressed are my own!

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************