
less than 1 minute to read
Easily creates a Collection from a FoxPro cursor. Creates either a FoxPro Collection or a wwCollection instance.
CursorToCollection(lcAlias,lnMode)
Return Value
a collection object or null on error
Parameters
lcAlias
Optional - The alias to convert. If not passed active alias is used
lnMode
Optional - 0* - Collection, 2 - wwCollection
Remarks
Web Connection internally uses wwCollection frequently and it offers more control and faster collection parsing. wwJsonSerializer also knows how to serialize wwCollection instances, but not FoxPro collections.
Example
foxpro
*** Create Collection Data
select * from Customers INTO CURSOR TQuery
loData = CursorToCollection("TQuery") && Collection of record objects
close data
*** Create cursor to receive the data
SELECT * FROM Customers where .F. ;
INTO CURSOR TQuery READWRITE
*** Load data into a cursor from a collection
CollectionToCursor(loData,"Tquery")
See also:
Class wwUtils | Class wwCollection | wwUtils::CollectionToCursor© West Wind Technologies, 1996-2024 • Updated: 09/24/21
Comment or report problem with topic