>>>I presume there is no way to place a UDF in the watch window and have it recalculated when the watch window refreshes, right?
>>
>>I don't have VFP with me right now. I thought all expressions - including UDFs - placed in the watch window would be re-evaluated, but I may be wrong.
>
>Just checked. Unfortunately it doesn't get recalculated.
>
>Alex
Now I am on a computer with VFP.
That is right: eval() by itself doesn't work.
The following, however, works:
Sample program:
SET STEP ON
x = 5
y = 10
x = 4
y = 2
function randomnumber()
return rand()
WARNING: This worked, but gave me a fatal error later. I found fatal errors common when trying to pull special tricks in the debugger (even some advanced functions that are documented).
Another alternative is to evaluate the following two expressions:
Application.DoCmd("MyResult = RandomNumber()")
MyResult
Again, RandomNumber() is a UDF, of course.
Saludos,
Hilmar.
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)