[Gambas-user] Stiil problems with EVAL
Steven Lobbezoo
steven at ...1652...
Mon Sep 3 20:09:23 CEST 2007
Le lundi 3 septembre 2007 19:32, ron a écrit :
> On Monday 03 September 2007 13:42, Steven Lobbezoo wrote:
> > CASE "li" ' Literal program variable
> > Rstr = Eval(Tag[1])
> >
> > Where Tag[] is :
> >
> > Tag[0] = "li"
> > Tag[1] = "Mglobal.U_nom"
> >
> > in Mglobal.U_nom is the string "Steven"
>
> uhmm
> Tag[0] = "li" <-- is string
> Tag[1] = "Mglobal.U_nom" <-- is probably string
Yes, it's a string
>
> Assume you put in object.TAG a string array, then Tag[1] is a string too.
>
> >From help:
>
> DIM Context AS New Collection
> Context["X"] = 2
> Context["Y"] = "Gambas"
> PRINT Eval("X * Len(Y)", Context)
>
> Context here is the TAG (Context) and the value is in TAG[1] (Len(Y))
> Looks to me the Eval line must be then Rstr = Eval(tag[1],Tag)
?????????????
>
> I'm afraid you must put the value of Mglobal.U_nom into Tag[1] instead the
> variable name.
That's no option, since i donnot know the var selected by the user.
>
> Or with luck next can do the job.
> DIM Context AS New Collection
> Context["X"] = Tag[0] 'li
> Context["Y"] = Tag[1] 'value of Mglobal.U_nom or "Mglobal.U_nom"
> PRINT Eval("Len(Y)", Context)
>
> Just my 2 cents
I'll try that
Thanks ron.
Steven
> Ron
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list