Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems in using the function EVALUATE()
Message
De
15/09/2017 07:51:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/09/2017 15:45:46
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP3
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01654324
Message ID:
01654353
Vues:
68
>Dear All,
>I have below codes
>
>m.KHour = 300
>
>HMF01 = "m.KHour * 1100000 / 110 "
>HMF02 = "110000"
>HMF03 = ""
>
>FOR ncounter = 1 TO 3
>STORE EVALUATE("m.HMF" + PADL(ALLTRIM(STR(nCounter)),2,"0")) TO nValue
>
>? nValue
>ENDFOR
>How should I use the EVALUATE() function to put a numeric value in the nValue variable?
>
>3000000 for HMF01
>1100000 for HMF02
>0 for HMF03
>
>Thank you for guiding


Simply remove the unnecessary quotes and string functions:
m.KHour = 300

HMF01 = m.KHour * 1100000 / 110
HMF02 = 110000
HMF03 = 0

For ncounter = 1 To 3
	Store Evaluate("m.HMF" + Padl(m.ncounter,2,"0")) To nValue
	? m.nValue
Endfor
Update: From other messages I see that you want to evaluate expressions stored in char fields. Then simply prefix with a "0":
m.KHour = 300

HMF01 = transform(m.KHour) + " * 1100000 / 110 " && or Textmerge("<< m.KHour >>  * 1100000 / 110 ")
HMF02 = "110000"
HMF03 = ""

For ncounter = 1 To 3
	Store Evaluate("0"+Evaluate("m.HMF" + Padl(Alltrim(Str(ncounter)),2,"0"))) To nValue
	? nValue
Endfor
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform