Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select to array won't keep the order

Status
Not open for further replies.

kenndot

Programmer
May 15, 2001
316
US
I'm setting the order of a table

set order to code

then doublechecking to make sure it really is ordered the way I want (and it is)

then

select * from table into array myarray

and the order isn't kept... why?

If this is in the FAQ's I apologize but I didn't see it...
 
Kenndot:

select * from table into array myarray ORDER BY CODE

Al
 
I think because SELECT does not recognise VFP tags.

Try SELECT INTO ORDER BY ....

If you want to generalise then

lcTag = TAG (table)

SELECT .. INTO ... ORDER BY &lcTag
 
didn't realize i could use the order by clause in a select to array, thank you!
 
kenndot

You could also sort your array using ASORT().

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top