Hi Alex,

great stuff, just one little flaw:
if there are 2 handlers in a script, "on foo" and "on fooBar", and the second comes first, searching for handler "foo" would find "fooBar". A simple fix might be to search (offset(...)) for either "on foo"&SPACE or "on foo"&RETURN

Cheers,
Valentin

Alex da Franca wrote:
Am 22.09.2005 um 14:22 schrieb Tim Welford:

That's a great start Kraig, thanks

Now I have just got to find some lingo to replicate the use of the
"go to handler" button in the script window.

the UIHelper xtra is your friend here.


activateScriptEditor memberNum, castlibNum, fromChar, toChar


on goToHandler handlername, scriptmember
  if ilk(scriptmember) <> #member then scriptmember = getScriptMember
(handlername)
  if ilk(scriptmember) <> #member then return 0
  handlername = "on" && handlername
  offs = offset(Return & handlername, scriptMember.scripttext)
  if offs > 0 then
    activateScriptEditor scriptMember.membernum,
scriptMember.castlibNum, offs, (offs + length(handlername))
  end if
end

on getScriptMember handlername
  handlername = symbol(handlername)
  repeat with m = the number of castlibs down to 1
    repeat with n = the number of members of castlib m down to 1
      if member(n,m).type = #script then
        if (script(member(n,m)).handlers()).getPos(handlername) > 0
then return member(n,m)
      end if
    end repeat
  end repeat
  return 0
end




---------------------------

  |||
a¿ex


[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi  To post messages to the list,
email [email protected]  (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to