PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Windev's equivalent function for common used 'EVAL' function
Windev's equivalent function for common used 'EVAL' function
Débuté par Han, 11 sep. 2008 18:28 - 3 réponses
Posté le 11 septembre 2008 - 18:28
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( [color=#FF0000]Eval[/color](sExample) )
should give the value: 13
Thanks in advance.
Kind regards, Han
Posté le 11 septembre 2008 - 19:28
Hi FireTox,
Thank you very much, this is what I'm looking for!
Kind regards,
Han
Posté le 11 septembre 2008 - 19:28
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
Posté le 11 septembre 2008 - 20:02
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( [color=#FF0000]Eval[/color](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