>>>>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
>>>
>>>
m.KHour = 300
>>>
>>>HMF01 = str(m.KHour)+ "* 1100000 / 110 "
>>>HMF02 = "110000"
>>>HMF03 = ""
>>>
>>>FOR ncounter = 1 TO 3
>>>STORE val(EVal("m.HMF" + PADL(ALLTRIM(STR(nCounter)),2,"0"))) TO nValue
>>>
>>>? nValue
>>>ENDFOR
>>
>>Dear Tore,
>>this is an example. the content of HMF01 is stored in a field.
>>I used VAL(EVAL()) , but when field content is empty, i get error.
>
>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