How can I get a list of files from directory ordered by date in NAV? I can't use the File virtual table because there is no key for the date. I've tried with DotNet but implementing the IComparer interface is far too complicated for me.
Any ideas?
Cheers
As a low-tech solution (i.e. not requiring any external components), how about creating a temporary File record variable in which you buffer the file records, populating the Path field with a sortable string representation of the file's Date and Time fields combined into a DateTime? [Please ignore that PAGE.RUN - that was there just for debugging purposes.]
On my machine, the first call to ShowFileOrder displays this:
The second call shows this:
And this is what the files look like in Windows Explorer:
I hope this helps! :)