General information
Category:
Coding, syntax & commands
Jim,
I've come to the same conclusion.
The real source of this problem is an ADO recordset. I am using the oRS.GetRows(MyArray) to load a set of records into an array so I can use it in a listbox. However, oRS.GetRows() returns records with tuples going sideways and not up/down like you need for a listbox.
I spent about 4 hours on this problem last night and finally found a solution for my particular problem. In my ADO recordset, some of the fields were currency fields and I needed to convert them to strings of fixed length for them to display properly (the way I wanted) in the listbox. I was doing this conversion in during the array transform. This was way too slow.
After much messing around, the solution was soooooo simple. I did the conversion in the SQL select of the ADO recordset. So instead of using:
"select field1,field2,currency1,currency2 from table"
in my ADO recordset command, I used:
"select field1,field2,str(currency1,8,2),str(currency2,8,2) from table"
Now, since my fields came back from the query as strings I could do the array transform at "top foxpro speed" and this turned out to be "good enough."
Thanks for you help, Scott
>>Jim,
>>
>>You're right about the size of the array. My current recordset is 3,000 records, so 65,000 won't be a problem.
>>
>>ACOPY() won't rearrange the array. The array is WIDE by TALL and I need it TALL by WIDE.
>
>Scott,
>
>In that case your code is about the only way you can get it done. Inverting matrix takes time.
>
>You might do better to leave it alone and process it the way it is.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only