LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about MultiFileSelectPopup

Hello,

When using MultiFileSelectPopup function like this:

MultiFileSelectPopup ("", " *.txt", "Open Multiple Odyssey Files", 0, 0, 1, &num_files, &file_list);

Let say that the following files are now in the file_list:
1.txt
2.txt
...
6.txt

When retrieving the files in a for loop and calling something like this:
*(file_list+i); i++;

It gave me 3.txt, 5.txt, 6.txt, 4.txt, 2.txt, and 1.txt. Is there an easier way to get it in order like 1.txt, ..., 6.txt?

Thanks,
Ngan Ly
0 Kudos
Message 1 of 5
(4,868 Views)
What version of CVI, Windows, and file system (FAT32 or NTFS) are you using?
Using CVI 6.0, Windows 2000, and an NTFS disk, the list is sorted, regardless of the order in which they were selected. It may be that in older version of Windows or on a FAT32 disk, the list is not sorted.
If your list is not sorted, it's not too difficult to use ANSI C qsort() to sort the list.
Look at the following example. It includes options to sort or not sort, increasing or decreasing, case sensitive or not.
Message 2 of 5
(4,860 Views)
Sorry to include that. I'm using CVI 7, Windows XP, NTFS. Then I guess the list should be sorted, but for some odd reason the list is not sorted? I will give the attachment a try. Thanks for including it.
0 Kudos
Message 3 of 5
(4,855 Views)
That was very useful. Thank you very much.
0 Kudos
Message 4 of 5
(4,842 Views)
Oops, I found the reply to this post really useful and intended to give it a high rating. I clicked on 1 instead of 5, and there was no way to retract it. Sorry.
0 Kudos
Message 5 of 5
(4,736 Views)