1. Marc James
  2. PowerBuilder
  3. Monday, 30 March 2020 10:58 AM UTC

Hello, I have a list of PDFs from a directory that have recently been scanned.

They are sorted wrong at the moment, I want the most recently modified (created) PDF at the top.

The current sort is alphabetical top to bottom, it would also work if I could sort bottom to top, as the filenames are sequential fortunately. But I tried the only option have for sorting on the ListView control which is called Sorted, TRUE or FALSE, neither change how it is sorted.... 

Please advise on best way to do this. Thanks

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 30 March 2020 12:14 PM UTC
  2. PowerBuilder
  3. # 1

Make it unsorted and sort the list before adding them to the control.

In this code example you can use Windows API functions to get a list of files. It loads the files into a DataStore to sort before adding to the list view.

https://www.topwizprogramming.com/freecode_filesys.html

Comment
There are no comments made yet.
Marc James Accepted Answer Pending Moderation
  1. Monday, 30 March 2020 13:33 PM UTC
  2. PowerBuilder
  3. # 2

Thanks for the quick reply, useful to know it's possible.

I was trying to step through it but it was taking too long for me to realise what it was I needed to pass/extract to use for my scenario, I think i'll just give them a GetFileOpenName

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.