Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluate
Message
From
29/06/2003 06:41:13
 
 
To
29/06/2003 05:27:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00805082
Message ID:
00805084
Views:
37
Hi Chaim

>Some one can give me information about this function and when do I have to use with this?

EVAL() is used to evaluate an expression and return the result. This is often used to resolve a reference to an object when one of several could be used. Code like this:
DO CASE
  CASE lcName = 'FirstObj'
    loRef = This.FirstObj
  CASE lcName = 'NextObj'
    loRef = This.NextObj
  CASE lcName = 'OtherObj'
    loRef = This.OtherObj
ENDCASE
can be replaced by simply:
loRef = EVAL( "This." + lcName )
which avoids the necessity of hard-coding all the alternatives and is much more efficient too.
----
Regards
Andy Kramek
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform