Equivalence to the SuperCard function call "via" object

Jo=?ISO-8859-1?B?6w==?=l Guillod joel.guillod at net2000.ch
Tue Jul 8 03:15:00 EDT 2003


Thanks for the idea Ken but no this does not help!

Yes, just try your scripts with:

on mouseUp
  put "Hello Ken Ray" into tMyVar -- HERE IS THE MODIFICATION !!!!!!!!!
  put "Goodbye" into tAnotherVar
  answer value("getSomeData(1,the date," & tMyVar & "," & tAnotherVar
&")",btn 2)
end mouseUp

and you will got the error:

value: error executing expression
Object    Button 1
Line    put value("getSomeData(1,the date," & tMyVar & "," & tAnotherVar
&")",btn 2) into fld 1
Hint    button id 1003 of card id 1002 of stack "Untitled 1"

I suggest to stop this thread discussion because there is no simple
implementation. I will use the call instruction and request a new feature...

Joel



> From: "Ken Ray" <kray at sonsothunder.com>
> To: <use-revolution at lists.runrev.com>
> Subject: RE: Equivalence to the SuperCard function call "via" object
> Date: Mon, 7 Jul 2003 22:59:52 -0500
> Organization: Sons of Thunder Software
> Reply-To: use-revolution at lists.runrev.com
> 
> Joel,
> 
> The value() function is what you need, but to include parameters, you
> need to include them like a "do". That is, if the parameter is a
> variable you need to "&" it. I ran your test like this:
> 
> Script of button 1:
> -------------------
> on mouseUp
> put "Hello" into tMyVar
> put "Goodbye" into tAnotherVar
> answer value("getSomeData(1,the date," & tMyVar & "," & tAnotherVar &
> ")",btn 2)
> end mouseUp
> 
> Script of button 2:
> -------------------
> function getSomeData p1,p2,p3,p4
> -- p1 is a number, p2 is a date, p3 is a string, p4 is a string
> return p1&&p2&&p3&&p4
> end getSomeData
> 
> When I clicked button 1, I got:
> 
> 1 7/7/03 Hello Goodbye
> 
> (which is what I expected). So variables are not evaluted before they
> are sent to the object - you need to force them to evaluate by "&"-ing
> them as in my example above.
> 
> Does this help?
> 
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/ 




More information about the use-livecode mailing list