Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning from a class method on error.
Message
From
07/12/2001 14:43:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Returning from a class method on error.
Miscellaneous
Thread ID:
00591378
Message ID:
00591378
Views:
56
I am using VFP 6 on 9x & 2000 machines. I designed a component GetKey that exposes a method GenKey designed to return Primary Key integers for my tables to use. I have setup an error routine to display errors I catch by calling the standard error method (that I modified) to trap -1 errors. I wish to be able to return to the calling program from that routine. I tried RETURN TO MASTER and I tried scanning the PROGRAM() programs and returning to Formxxx.Add but both failed. It kept returning to the next line in the local method.


So, here is the scenario:

Form1 is running its Add method.

That method calls Form1.cstGetKey.GenKey( "TableName" ) where tablename is the name of the table to generate a key for.

Somewhere in the middle of the routine an error occures causing Form1.cstGetKey.Error(-1,mymessage,0) to fire.

From there I want to return to Form1.Add() without further execution of the GenKey method. This shouldn't be a problem but I must be dense because I can't find the solution.

Thanks in advance

Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Next
Reply
Map
View

Click here to load this message in the networking platform