I'm looking for a way to list or capture the declared variables programmatically, along with their values.
MikeLewis refers to an error handler written entirely in FoxPro which sounds like it does exactly this in this thread: thread184-1687712.
Here is the motivation: We have a wrapper which executes stored scripts and I'm interested in being able to take a snapshot of the variables which are defined when the wrapper begins, and return the environment to this state once the script exits.
Please note:
[ol 1]
[li]I'm aware of SAVE TO/RESTORE FROM, these almost work, but restoring from there (obviously) does not properly restore objects.[/li]
[li]Yes it's possible that variables are declared PUBLIC inside the script which causes them to remain in scope when the script exits. I know that somebody will be screaming inside that this is bad form, but let's keep that on the inside. It's just the way it is.
[/li]
[/ol]
The SAVE TO/RESTORE FROM is really great, except that I'd like to just release any variables which have popped up since the snapshot was taken, and parsing that binary is something I'd like to avoid. (Referring to the same thread as above.) Even better would be able to implement something like what Mike refers to in that thread and capture the values of all the declared variables programmatically.
Essentially, if I had the foxcode implementation for generating the list supplied by intellisense when you type "m." I'd be happy.
Thanks ahead of time!
-TRH
MikeLewis refers to an error handler written entirely in FoxPro which sounds like it does exactly this in this thread: thread184-1687712.
Here is the motivation: We have a wrapper which executes stored scripts and I'm interested in being able to take a snapshot of the variables which are defined when the wrapper begins, and return the environment to this state once the script exits.
Please note:
[ol 1]
[li]I'm aware of SAVE TO/RESTORE FROM, these almost work, but restoring from there (obviously) does not properly restore objects.[/li]
[li]Yes it's possible that variables are declared PUBLIC inside the script which causes them to remain in scope when the script exits. I know that somebody will be screaming inside that this is bad form, but let's keep that on the inside. It's just the way it is.
[/li]
[/ol]
The SAVE TO/RESTORE FROM is really great, except that I'd like to just release any variables which have popped up since the snapshot was taken, and parsing that binary is something I'd like to avoid. (Referring to the same thread as above.) Even better would be able to implement something like what Mike refers to in that thread and capture the values of all the declared variables programmatically.
Essentially, if I had the foxcode implementation for generating the list supplied by intellisense when you type "m." I'd be happy.
Thanks ahead of time!
-TRH