[Gambas-user] gb2 Eval() question

Benoît Minisini gambas at ...1...
Wed Apr 27 02:00:48 CEST 2011


> hi,
> i've been playing around with Eval() for some days, i read that it
> evaluates only expressions so i understand that DIMs raise "unexpected
> DIM" but what about SHELL and EXEC which also raise "unexpected ..."
> what is the difference between
> Eval("hProcVar = SHELL \"zenity --info --text hello\" WAIT",
> hVarCollection) and
> Eval("iIntVar = 5 * 6", hVarCollection)?
> I think both are assignments to variables and thus expressions? (The
> same with DIM Var AS Integer = 7 but which I think just tells to make
> room for a variable and initialises it so isn't an expression, right?)
> I found nothing else in gb.eval Expression class than "You can use
> almost any Gambas subroutines and operators."
> What are the criteria of a gambas expression?
> 
> best regards,
> tobi
> 

In Gambas 2, Eval() cannot evaluate assignments, nor instructions.

In Gambas 3, Eval() can evaluate assignments, by using the "LET" keyword at 
the beginning of the expression string.

Regards,

-- 
Benoît Minisini




More information about the User mailing list