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.

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"
    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.

use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to