Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
State of a cursor in error log
Message
 
 
To
24/04/2022 00:03:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684235
Message ID:
01684240
Views:
27
>>>>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.
>
>If you've already logged an error and have a call stack, you could start with that.
>
>If you want to cover everything, maybe there's some way to automatically add that code everywhere relevant to create a debug build.
>
>If that's not appetizing maybe you need a debug condition that's more specific.

I will review the error log and see if it keep repeating. Then I can add the code to check the condition of the cursor in just a few places.
Thank you for your 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
Previous
Reply
Map
View

Click here to load this message in the networking platform