below is my current routine , it will load a listbox, it only sorts by name.
is there a way to sort by type putting all directories at the top or the list, files at the bottom?
for f folderitem is there a method or class that returns the size of the file ? ex:: f.sizeoffile ?
[code]For Uct As Integer = 1 to ListBoxCount
Dim f As FolderItem = appFolder.Item(Uct)
If f <> Nil Then
iBox.AddRow
r = iBox.LastIndex
iBox.Cell(r, 0) = f.Name
iBox.Cell(r, 1) = str(f.ModificationDate)
iBox.Cell(r, 2) = “”
if f.Directory = true then
iBox.RowPicture® = folderiCon16
end if
End If
Next
iBox.ColumnsortDirection(0)=ListBox.SortAscending
// iBox.ColumnType(0) = 2 // add checkboxes
iBox.SortedColumn=0 //first column is the sort column
iBox.Sort
[/code]
i don’t get docs when i click on the Help (?) button so no i did not check there. but i did do the . + [TAB] list and did not see anything that returns file size.
[quote=349129:@David Cullins]i got the link
so the comparerows will the listbox. but how do i sort it by directory, then files ?[/quote]
put the necessary code to compare the two sets of fields in the CompareRows event
compare directory first… if they are EQUAL then compare the file names
so when i am first loading the ListBox i could compare if the file is a Dir or File.
If Dir i could set the rowTag = “d”
Later in the CompareRows Event i could compare the RowTag for the “d” value and if so push that row higher up the list
or would you consider this a crude way of sorting Drectories and Files ?