>I think method 1 will be slow, since i have to create a cursor, then create the CSV file ( that's 2 files in disk ) then filetostr() it...
>I need fast, since this is in a web service where i have to transform the response array into a string
Depends on the size of the output
If the array is not very big, you can use method 2 and append to string instead of outputting to a file
As the string gets longer, appending to it will take more time ( reason for fcreate )
Using an ADODB.Stream (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms677486(v=vs.85).aspx ) and append to it is also a possibility
But I guess you'll have to time all the possibilities
>>>Hi Gregory
>>>Thanks for your help. Method 2 is what i was thinking about since i need to produce a string, but thought somebody may have a less tedious method :-)
>>>
>>
>>Jaime,
>>
>>Then consider method 1 ?
>>
>>>>>Hi
>>>>>What would be the fastest way to convert a two dimensional array into a CSV string?
>>>>>
>>>>>Thanks
>>>>>Jaime
>>>>
>>>>Two possibilities
>>>>
>>>>(1)
>>>>
>>>>Create a cursor
>>>>insert from array
>>>>copy to ..... type csv
>>>>filetostring()
>>>>
>>>>
>>>>
>>>>(2)
>>>>
>>>>fcreate
>>>>loop through rows
>>>> loop through colums
>>>> output field
>>>> endloop
>>>> output CRLF
>>>>endloop
>>>>fclose
>>>>filetostring()
>>>>
Gregory