Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass or return a cursor
Message
From
04/05/1999 23:35:50
 
 
To
04/05/1999 14:51:33
Sonny Chouinard
CHCA Computer Systems Inc.
Lachenaie, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00214987
Message ID:
00215222
Views:
45
>>>>How do I pass or return a cursor to/from a function or a form? Do I need to convert the cursor to an array?
>>>
>>>IF it is in the same datasession, there is no problem using the same cursor. You can always pass the cursor name in parameter. You can send the name of the datasession also...
>>
>>In order to return both, you'd need to pass an object back, or modify something passed by reference.
>
>Does a cursor acts like an object?

No, but the return requires two distinct pieces of information at least - a data session and an alias. RETURN hands back a single thing; you can't RETURN an array directly, so you need an object with at least two properties to give back the necessary details.

Another approach would be to create the object based on a Form class with a private data session. Open the cursor in the object's private data session, and hand back the form to the caller as an object. This encapsulates the cursor in an object that can survive the return - if you create a cursor in a private datasession and then terminate the data session the cursor will go away.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform