Sub Process_Globals
Type FileItem (Dir As String, FileName As String, Size As Long, Date As Long)
End Sub
Sub AppStart (Args() As String)
Dim files As List = ListFolderSortedBySize("C:\Users\H\Downloads")
For Each f As FileItem In files
Log(f)
Next
End Sub
Private Sub ListFolderSortedBySize(Folder As String) As List
Dim res As List
res.Initialize
For Each f As String In File.ListFiles(Folder)
res.Add(CreateFileItem(Folder, f, File.Size(Folder, f), File.LastModified(Folder, f)))
Next
res.SortType("Size", True)
Return res
End Sub
Public Sub CreateFileItem (Dir As String, FileName As String, Size As Long, Date As Long) As FileItem
Dim t1 As FileItem
t1.Initialize
t1.Dir = Dir
t1.FileName = FileName
t1.Size = Size
t1.Date = Date
Return t1
End Sub