Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
State of a cursor in error log
Message
 
 
À
23/04/2022 16:51:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01684235
Message ID:
01684237
Vues:
28
>>I am pretty much sure that what I am asking is not possible. But I will ask anyway, just in case.
>>
>>When I scan (with FOR) though the Stack array (ASTACKINFO), can I get the state of an alias at each point? That is, say, I want to see if an alias cAlias was open or close at each FOR?
>>
>>ASTACKINFO(aProgStack)
>>FOR iEle = 1 TO ALEN( aProgStack, 1 )
>>        ?? select(cAlias) > 0
>>NEXT
>>
>
>What you're asking for is history. Unless explicitly saved, it isn't available; subsequent calls could close or open a given alias ad infinitum.
>
>You could manually log the state of the alias immediately before each subsequent call, or you could wrap your calls in a function which does that logging.
>
>One way would be to declare a local variable and set its value immediately prior to your next call:
>
>LOCAL llIsAliasOpen
>llIsAliasOpen = SELECT( cAlias ) > 0
>
>MyNextMethodFunctionOrProcedureCall()
>
Then, in your error handler you can LIST MEMORY. It will show a bunch of llIsAliasOpen memvars, one at each call level, with its value at that level.

Since I don't know which segments of the code will be checked, this will require me to have the above code in million of places. Thanks for the suggestion.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform