Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Graceful exit on ESC from triggers and rules
Message
From
07/04/2005 17:07:48
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01002344
Message ID:
01002432
Views:
26
This message has been marked as the solution to the initial question of the thread.
the class definition MUST be in a separate but accessable procedure, such as a separate procedure in the database stored procedures. I would base the class on Custom or Relation because we need this class to participate in the current datasession.

You may want to design this class in one of your Classlibraries because this technique can be generalized and subclassed as necessary as a state restorer class. (Memento pattern)

Glenn

>No, what I meant is can I put
>
>define class myClass as container && or should it be session or what?
>
>inside the SP?
>
>>If you make the Variable LOCAL or PRIVATE I see no reason why not. They will get destroyed when the program ( stored procedure ) returns to the calling code.
>>
>>Glenn
>>
>>>Can I put class definition in the Stored procedure?
>>>
>>>>Yes Nadya, the local variable when going out of scope will cause the object destroy event to fire.
>>>>Glenn
>>>>
>>>>>>I suppose you could create a local Object at the beginning of the routine and store state to it. In the destroy event of the object it can restore state.
>>>>>>
>>>>>>Glenn
>>>>>
>>>>>Good idea! So, this variable is get destroyed when you interrupt by ESC? E.g. does Destroy fire when you Cancel out of procedure?
>>>>>
>>>>>In the meantime I tried my idea of CleanUp, but it doesn't seem to work, e.g. I don't know how to invoke this VFP interrupted dialog programmatically...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform