PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Formula calculation
Formula calculation
Débuté par Sergio Valente, 30 sep. 2005 13:22 - 2 réponses
Posté le 30 septembre 2005 - 13:22
Hello All

I'm a Novice in Windev 8 I would like if possivle to have some help from You.

I would like to know if there are any way to calculate formulas in windev8.

Example:

I have a string variable that as a Formula (145 / 145)*100
and i would like to have the result in an Integer variable
Posté le 30 septembre 2005 - 15:13
Hello Michael


it works perfectly for my needs

Thank You Very Mutch
Sergio Valente
Posté le 30 septembre 2005 - 16:31
"Sergio Valente" <sv@ecco.com> a écrit dans le message de news:
433d0b13$1@news.pcsoft.fr...


Hello All

I'm a Novice in Windev 8 I would like if possivle to have some help from

You.

I would like to know if there are any way to calculate formulas in

windev8.

Example:

I have a string variable that as a Formula (145 / 145)*100
and i would like to have the result in an Integer variable


Hello Sergio,

Your code should look like this :

--------------
str_Formula is string = "(145/145)*100"
str_WdCode, str_Compile is string
extern MyFunc

str_WdCode = "result "+str_Formula+CRLF
str_Compile = Compile("MyFunc", str_WdCode)
if str_Compile~="" then
Info("Result="+MyFunc())
Compile("MyFunc", "")
else
Error("Compile error", str_Compile)
end
-----------

I typed the code directly in this message, so there may be some typos...

Regards,

Michel Fages