Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to Order an ADIR by date
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00357284
Message ID:
00357291
Views:
16
>What would be the best way to order an ADIR array by file date? Oldest to youngest.

Mike,

Use ASORT() like this:
* a_dir is the name of the array created by ADIR()
lnitems = ALEN(a_dir, 1) + ALEN(a_dir, 2)
= ASORT(a_dir, 3, lnitems, 1)
Keeping in mind that this is purely by date, so two files with the same date may not be sorted correctly. In order to do that, you'd have to create a date/time type.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform