On 4/4/06 9:30 AM, "Alex Tweedly" <[EMAIL PROTECTED]> wrote:

> Of course, you still can't distinguish between a variable which is
> undefined and one which has been deliberately set to empty :-(

Here's a technique based on what revvariablewatcher.rev does:

Step 1: create a stack
Step 2: create a field
Step 3: paste the following handlers into the stack script
Step 4: click the stack

on mouseUp
  put 1 into t
  a
end mouseUp

on a
  answer callerVariableExists("t") & cr & callerVariableValue("t")
end a

function callerVariableExists pVariableName
  put empty into fld 1 of me
  set the debugContext to line -3 of the executionContexts
  debugDo "put the variableNames into fld 1 of me"
  set the debugContext to empty
  return pVariableName is among the items of line 2 of fld 1 of me
end callerVariableExists

function callerVariableValue pVariableName
  put empty into fld 1 of me
  set the debugContext to line -3 of the executionContexts
  debugDo "put the variableNames into fld 1 of me"
  if pVariableName is among the items of line 2 of fld 1 of me then
    debugDo "put" && pVariableName && "into fld 1 of me"
  else
    put empty into fld 1 of me
  end if
  set the debugContext to empty
  return fld 1 of me
end callerVariableValue

-- Dick



_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to