>Please be more specific:
>What is this 'lcaname','loref'.
>Can you give me example from the life?
Andy's example assumes several objects on a form, and a property that has the object name.
The objects might be a group of TextBoxes, for instance, which you may want to manipulate in a loop.
Here is an example which you can easily reproduce. Place three text-boxes on a form, leaving the default names (Text1, Text2, Text3).
Note: for a production system, it is recommended to give more meaningful names - leave the names for this sample only.Add a CommandButton to the form. In its Click() event, place the following code:
for i = 1 to 3
loTextBox = evaluate("ThisForm.Text" + trans(i))
loTextBox.FontBold = .T.
next
This will make the text in the three TextBoxes bold.
Used this way, evaluate() can often simplify programming.
A quite different use of evaluate() is to calculate formulas typed by a user:
x = "1+2*3"
? evaluate(x)
This is somewhat risky, since the user can also use this to execute any procedure of your system.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)