carrying a global variable from stack to sub stack

Admin admin at mfelkerco.com
Sat Jul 30 20:30:15 EDT 2011


  

Thank you. 

The only place I did not have it was in my stack's
script with the openstack handler. 

Duh! 

Mike 

On Sat, 30 Jul 2011
17:34:58 -0400, Slava Paperno wrote: 

>> How do you carry a global
variable from one stack to a substack?
> 
> If you set a global variable
in the main stack:
> 
> on preOpenStack
> global gMyName
> 
> put "Mike"
into gMyName
> end preOpenStack
> 
> then in any card in any substack
you can retrieve the value like so:
> 
> on openCard
> global gMyName
>
answer gMyName --you will see "Mike"
> end open Card
> 
> In other
words, nothing needs to be done to "carry" a global variable from
> one
stack to another. All you have to do is declare it with the word
>
"global" in front.
> 
> S.
> 
>> I have this set of commands on every
page of every stack in my project: on opencard --Create a global
variable for the db global dbID global curUserID global UN put
numtochar(39) into SQ I then proceed to login to the database (works
fine normally) and then access whatever data I need. I just created a
substack called CV with three pages - pgCV1, pgCV2 and pgCV3 I need the
login credentials of the user to carry over so the fields on these pages
can be populated with the existing data on the database. The important
variable is dbID and curUserID What do I need to do, other than the
global command, to make this happen? Mike
> 
>
_______________________________________________
> use-livecode mailing
list
> use-livecode at lists.runrev.com [1]
> Please visit this url to
subscribe, unsubscribe and manage your subscription preferences:
>
http://lists.runrev.com/mailman/listinfo/use-livecode [2]

 


Links:
------
[1] mailto:use-livecode at lists.runrev.com
[2]
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list