Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Breakpoint that doesn't fire as var goes in and out of s
Message
De
28/08/2003 10:25:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
27/08/2003 21:08:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00823656
Message ID:
00824180
Vues:
22
>>>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:
* Please evaluate the following expression in the watch window:
* Application.Eval("randomnumber()")

SET STEP ON
* Just a few sample commands:
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()")

* and:

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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform