Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems in using the function EVALUATE()
Message
From
14/09/2017 16:36:44
 
 
To
14/09/2017 16:29:40
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP3
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01654324
Message ID:
01654334
Views:
58
>>Please create a sample with a cursor, then it's more realistic.
>
>
>CREATE CURSOR MyCursor (HMF01 C(25), HMF02 C(25), HMF03 C(25))
>INSERT INTO MyCursor (HMF01, HMF02, HMF03) VALUES ("m.KHour * 1100000 / 110", "1100000", "")
>
>m.KHour = 300
>
>FOR ncounter = 1 TO 3
> STORE EVAL(EVALUATE("HMF" + PADL(ALLTRIM(STR(nCounter)),2,"0"))) TO nValue
>
> ? nValue
>ENDFOR
>
>USE IN MyCursor

This is a very good example of a very bad data design. Why store it that way????? If you have no control over this, then you must simply add a special handling of the first case.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform