Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clever way to close all cursors
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00124575
Message ID:
00124590
Views:
25
Hi Evan,

Create a custom class named something like cSaveCursors with a property array named aCursors. Then, in the init of the class add the following code:

= AUSED(This.aCursors)

In the destroy add this code:

LOCAL ;
laCursors[1], ;
lnCursors

LOCAL ;
laCursors[1], ;
lnCursors

lnCursors = AUSED(laCursors)
FOR lnI = 1 TO lnCursors
IF ASCAN(This.aCursors, laCursors[lnI,1) = 0
USE IN (tcCursor)
ENDIF
NEXT


Then all you need to do is something like loCursors = CreateObject("cSaveCursors") and when loCursors is released all cursors that were opened after it was instantiated will be closed.
Mike Feltman

F1 Technologies
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform