Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluate column
Message
 
 
To
02/11/2009 09:46:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01432689
Message ID:
01432693
Views:
43
>Hi
>I need help to understand the 'Evaluate' function.
>
>Please try run the following example:
>
create cursor mycursor (id i,col1 c(3),col2 c(3),col3 c(3))
>insert into mycursor (id,col1,col2,col3) values(1,'AA','BB','CC')
>insert into mycursor (id,col1,col2,col3) values(2,'EE','FF','GG')
>
>select mycursor
>scan
>	for I=1 to 3
>		ccolval=evaluate(mycursor+'.COL+str(i)')
>		messagebox(ccolval)
>	endfor
>endscan
>
>Tnx
for I=1 to 3
		ccolval=evaluate('mycursor.COL'+transform(i))
		messagebox(ccolval)
	endfor
ccolval=evaluate('mycursor.COL'+str(i)) && would be evalute('myCursor.Col1'), etc.

and evaluate ('myTable.FieldName') returns the value in the field name.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform