Welcome! Log In Create A New Profile

Advanced

Windev's equivalent function for common used 'EVAL' function

Posted by Han 
Hi,

I'm searching the Windev help file but I can't find it....
What is the Windev's equivalent function for the EVAL function common used in other development languages.

e.g.

sExample is string
sExample = "8 + 5"

info( Eval(sExample) )

should give the value: 13

Thanks in advance.

Kind regards, Han


Hello

use the dynamic compilation

Function eval(p_myString is string)

v_res is string
v_nomProc is string = "XXYYZZ"

v_myCode is string
v_myCode = "v_resultat est une chaine"+CR
v_myCode += "v_resultat = "+p_myString+CR
v_myCode += "renvoyer (v_resultat)"

v_res = Compile(v_nomProc,v_myCode)
IF (v_res = "") THEN RESULT ExecuteProcess(v_nomProc,trtProcédure)
RESULT("")

and for use : Trace(eval("8 + 5"))
give you : 13

Regards
Hi FireTox,

Thank you very much, this is what I'm looking for!

Kind regards,

Han
marcel.berman@managingbusiness.be.pcs
Re: Windev's equivalent function for common used 'EVAL' function
September 11, 2008 06:01PM
Hi !

On 11-Sep-2008, Han <guest@news.pcsoft.fr> wrote:

> Hi,
> I'm searching the Windev help file but I can't find it....
> What is the Windev's equivalent function for the EVAL function common used
> in other development languages.
> e.g.
> sExample is string
> sExample = "8 + 5"
> info( Eval(sExample) )
> should give the value: 13
> Thanks in advance.
> Kind regards, Han


You should look for compile()
Hope it will be helpfull !

--
Marcel Berman
Président de Be-Dev.be (www.be-dev.be) (Belgique)
Membre du CA de Wind'Asso (www.windasso.org) (France)
Be-Dev.be et Wind'Asso sont des associations d'utilisateurs des produits
PC-Soft
Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: