Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help using 'return to program' with methods vs. function
Message
De
14/08/2001 23:42:46
 
 
À
14/08/2001 20:00:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00543789
Message ID:
00543879
Vues:
20
Jim,

Thanks for your reply. Given the fact that VFP 7 doesn't introduce any new capabilities in this regard, do you have any other suggestions on how I can return to a specific level in the call stack, i.e. as in 'return to lnlevel' where lnLevel is an integer denoting the specific stack level to return to.

I also re-read George Tasker's Foxtools help without finding any relief. My only thought, short of a service pack release from MS is that someone might have developed a FLL that allows the VFP call stack to be manipulated.

Without knowing what's involved, the solution seems pretty simple. I would think it would be easier to return to a specific level by integer stack index (a simple assignment) vs. searching up the stack for the first matching function name???

Hoping for clever way to skin this fox!

Malcolm

>Malcolm,
>
>Based on the Help (VFP7) for RETURN command, you're likely pissin into the wind.
>
>It states explicitly "procedure name" as the TO clause parameter. I think we all agree that methods are methods and not procedures, even though they look a heck of a lot like procedures.
>
>JimN
>
>>I'm trying to use the 'return to program' statement to return to method code earlier in my program stack. The problem is that program() returns method code names as objectname.method but the 'return to program' syntax does not accept program names with periods.
>>
>>So, my first strategy was to use juststem() to strip the objectname prefix from values returned by program(), using the resulting method name as the program name for the 'return to program' statement.
>>
>>This sort-of-works. What happens is that VFP returns to the most recent routine on the program() stack with the same name. This means that if you have nested method calls of the same name, but from different objects, VFP will return to the most recent method of the same name, not necessarily the method associated with a specific object or the appropriate program stack level.
>>
>>Does anyone know how to get around this problem, i.e. how I can use a 'return to objectname.method' syntax to return to a specific function on the call stack? Or if that is an impossibility, is there a way to return to a specific function on the call stack by call stack depth, i.e. return to the 5th function on the call stack via something similar to 'return to 5'. I wonder if the VFP C++ Developers Kit allows a FLL to adjust the call stack pointer (depth) or change the current statement pointer?
>>
>>The motivation behind this query is my intent to create the equivalent of 'try/catch/finally' (ala Java, C++, .NET) error handling logic in my applications.
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform