> I know I've done this before, but if I have a button I'd like 
> to assign a handler to call and a parameter to pass, what's
> the best way of doing this? 
> 
> Assign both pHandler and pArg to symbols, or strings? And then
> just 
> 
> on mousedown me
>       do (pHandler & "("& pArg & ")")
> end
> 
> ?

You want to build a string that looks exactly like the Lingo you want to execute. 
Therfore if the Lingo command you'd like to execute would look like this:

myHandler(5,#hello,"goodbye")

then you have to build and execute that string like this:

tHandler = "foo"
tArg1 = string(5)
tArg2 = "#"&string(#hello)
tArg3 = QUOTE&"goodbye"&QUOTE

tLingoString = tHandler & "(" & tArg1 & "," & tArg2 & "," & tArg3 & ")"

do tLingoString

You must pass the do command a string to execute, the problem with string converting 
symbols is that the # is removed (string(#hello) results in "hello" for example, you 
must manually add the #) and you must also be sure to manually include QUOTE 
characters around any legit string arguments that you pass.

The above works for me, passing the three arguments (5,#hello,"goodbye") to my handler 
foo in a movie script. Hope that helps.

Cheers,
Tom Higgins
Product Specialist - Director Team
Macromedia
[EMAIL PROTECTED] 

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