Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Traversing The Call Stack To Get Variable Values
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01038666
Message ID:
01038914
Vues:
24
>DISPLAY MEMORY only captures variables for the current
>procedure you're in.
>
>If the procedure throws an error and transfers control to
>an ON ERROR routine, then the only variables availble that
>DISPLAY MEMORY sees are those in scope in the ON ERROR routine.
>
>

Kevin,

That doesn't seem to be the case, or I may be missing something. Run this in a prg:
ON ERROR DO xErr
=xvars1()

**************************
FUNCTION xVars1
**************************
LOCAL x1
x1 = 1
=xVars2()

********************
FUNCTION xVars2
********************
LOCAL x2
x2 = 2
DO xVars3

*********************
PROCEDURE xVars3
********************
LOCAL x3
x3 = 3
ERROR X

***********************
FUNCTION xErr
**********************
DISPLAY MEMORY LIKE x*
RETURN
And, this is the result of DISPLAY MEMORY, which works for all vars defined
X1          Local  N  1           (         1.00000000)  xvars1
X2          Local  N  2           (         2.00000000)  xvars2
X3          Local  N  3           (         3.00000000)  xvars3
    3 variables defined,    0 bytes used
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform