>>>>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.