send "Rawkeydown param" problem

Ken Ray kray at sonsothunder.com
Sun Feb 12 21:49:57 EST 2006


On 2/12/06 6:54 PM, "Howard Bornstein" <howard.bornstein at gmail.com> wrote:

> On 2/12/06, Phil Davis <davis.phil at comcast.net> wrote:
>> Hi Howard,
>> You could try displaying 'the executionContexts' in an 'errorDialog'
>> handler of your stack script - maybe that will give you some clues as to
>> what's happening.
>> 
>> Phil Davis
> 
> Where did you find information about "the executionContexts"? I
> couldn't find any reference to it in the docs so I don't know how to
> interpret the results.
> 
> It gave: stack 
> "/Users/howard/Projects/LandyVision/LandyPlayer.rev",errorDialog,198
> 
> What does 198 refer to?

ExecutionContexts are in the form:

  <long id of object>,<handlerName>,<lineNumber>

so 198 is the line number.

Here's a handler I use to reformat the executionContexts into a
"human-readable" form:

function stsFormatContexts pContexts
  -- ExecutionContexts is in form: <long id of
object>,<handlerName>,<lineNum>
  -- Assumes CR-delimited contexts
  put "" into retVal
  repeat for each line tLine in pContexts
    put tLine into tContext
    put item -1 of tContext into tLineNum
    put item -2 of tContext into tHandlerName
    delete item -2 to -1 of tContext
    do "put the long name of" && tContext && "into tObj"
    put offset("of stack",tObj) into tChar
    if tChar <> 0 then
      put char 1 to tChar+7 of tObj && quote & GetStack(tObj) & \
        quote into tObj
    else
      put "stack" && quote & GetStack(tObj) & quote into tObj
    end if
    put "line" && tLineNum && "of handler" && quote & tHandlerName & \
      quote && "of" && tObj & cr after retVal
  end repeat
  delete last char of retVal
  return retVal
end stsFormatContexts

function GetStack pObj
  -- Needs to handle all sorts of incoming values -
  -- file names, long names, abbr names, etc., from
  -- all kind of objects and return the stack's short name
  local tRetVal
  put ".rev" into tStackExtension
  if word 1 of pObj = "stack" then
    if offset("of stack " & quote,pObj) <> 0 then
      -- substack
      get matchText(pObj,"stack \"(.*?)\" of stack",tRetVal)
    else
      -- main stack
      get matchText(pObj,"stack \"(.*?)\"",tRetVal)
    end if
  else
    -- object on a stack
    get matchText(pObj,"of stack \"(.*?)\" of stack \".*?\"",tRetVal)
    if it is false then
      get matchText(pObj,"of stack \"(.*?)\"",tRetVal)
      if it is false then
        put pObj into tRetVal
      end if
    end if
  end if
  put length(tStackExtension) into tExtLen
  if char (-1 * tExtLen) to -1 of tRetVal = tStackExtension then
    -- file path, convert to stack name
    put the short name of stack tRetVal into tRetVal
  end if
  return tRetVal
end GetStack

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list