Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting an ADIR by date modified
Message
De
22/10/2008 02:21:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/10/2008 11:18:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01356078
Message ID:
01356206
Vues:
23
>Hey,
>
>I just wrote this to sort an adir array by datetime modified.
>
>If I'm not mistaken, this should avoid any problem with ambiguous dates despite using CTOT().
>
>But it seems like a clunky way to do it. I figured I'd just ask for fun if there are any other creative ways of doing this.
>
>
>nFiles = ADIR(aa)
>FOR i = 1 TO nFiles
>aa[i, 5] = DATETIME(YEAR(aa[i, 3]), MONTH(aa[i, 3]), DAY(aa[i, 3]), ;
>	HOUR(CTOT(aa[i, 4])), MINUTE(CTOT(aa[i, 4])), SEC(CTOT(aa[i, 4])))
>ENDFOR 
>=ASORT(aa, 5)
>
ADIR(aa)
CREATE CURSOR xx (FileName c(254), fileSize i, fileDate d, fileTime c(8), fAttr c(5))
APPEND FROM ARRAY aa
SELECT * FROM xx ORDER BY fileDate, fileTime && into array aa
PS: Check for filer.dll. And if I did your way then would write as:
aa[m.i, 5] = dtot(aa[m.i, 3]) + (ctot(aa[m.i, 4]) - ctot('0'))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform