Information générale
Catégorie:
Codage, syntaxe et commandes
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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement