Understanding 'the defaultStack'
Jeanne A. E. DeVoto
revolution at jaedworks.com
Tue Oct 11 03:13:24 EDT 2016
At 4:42 PM -0400 10/9/2016, 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"
How should this work for subroutines? Should the "using" scope also
propagate to any handlers called from within the block?
on mouseUp
using stack "My Stack"
answer field 1 of card 2 -- of stack "My Stack"
doSomethingElse
end using
end mouseUp
-- maybe in another object's script:
on doSomethingElse
answer field 2 of card 2 -- of My Stack? Or the current defaultStack?
end doSomethingElse
I'm inclined to think that anything that's called from within a
"using" block should use that scope in turn.
More information about the use-livecode
mailing list