DEFINE CLASS MyCursor As ... cursorname="" PROCEDURE Init(...) * create and populate cursor somewhere here ... ENDDEFINECreate an instance of this class inside your function and return it as the result. But it's almost the same as passing back the cursor's name as Sergey suggested.