Question on Value Function

Matt revcompgeek at gmail.com
Mon Dec 25 15:47:31 EST 2006


On 12/20/06, Jeanne A. E. DeVoto <revolution at jaedworks.com> wrote:
>
> At 4:21 PM +0000 12/20/2006, Dave wrote:
> >Hi All,
> >
> >I am calling a function in another stack using the value function. This
> code work great:
> >
> >    get value("Initialize(" & myEnableFlag & ")", myStackFileName)
> >
> >But how can I add another parameter to the call? The following gives an
> execution error:
> >
> >    get value("Initialize(" & myEnableFlag & "," & myString & ")",
> myStackFileName)
>
>
> Try wrapping it in "do":
>
>   do "get value(" & quote & "Initialize(" & myEnableFlag,myString & ")" &
> quote,myStackFileName & ")"
>
> Very strange-looking, but it works.
> --
> jeanne a. e. devoto ~ revolution at jaedworks.com
> http://www.jaedworks.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

You might also try wrapping it in quotes:

get value("Initialize(" & quote & myEnableFlag & quote & "," & quote &
myString & quote & ")", myStackFileName)

Also, using a comma with two variables on the sides just adds a comma in the
middle for example (myVar1 & "," & myVar2) is the same as (myVar1,myVar2).
So like in above you could do:

get value("Initialize(" & (quote & myEnableFlag & quote,quote & myString &
quote) & ")", myStackFileName)

Which might make it a bit more readable.

-- 
Matthew Peterson
Programmer
CMSEC



More information about the use-livecode mailing list