Understanding 'the defaultStack'

Dave Kilroy dave at applicationinsight.com
Sun Oct 9 16:52:58 EDT 2016


+1 on a ‘using … end using’ block - it would be so useful!


On 10/9/2016 9:35 PM, Paul Dupuis wrote: 
> Some long time ago, someone on this list suggested a control block such 
> as "using <objectReference>" ... "end using" 
> 
> Where any object references in the block would always be evaluated 
> relative to the object referred to in the start of the using block. 
> So: 
> 
> using card 3 of stack "X" 
>   put the label of btn "A" into myVar 
>   ... 
> end using 
> 
> Would look for button "A" on card 3 of stack "X" 
> 
> using stack "X" would be essentially the same as set the defaultStack to "X" 
> 
> but you could also do things like 
> 
> using grp id 1005 of card 3 of stack "X" 
>    repeat with i=1 to the number of fields 
>      -- would refer only to the field in group ID 1005 of card 3 of 
> stack "X" 
>    end repeat 
> end using 
> 
> nested using block would presumably be possible 
> 
> I always though this enhancement would be a great addition to LiveCode. 
> I would suggest this as a compliment to the defaultStack. 



More information about the use-livecode mailing list