'ON Process_Globals
Type NameAndSize(name As String, size As Long)
'...
Dim list1 As List
list1=File.ListFiles(File.DirInternal&"/mydir")
Dim list2 As List :list2.Initialize
For i=0 To list1.Size-1
Dim fns As NameAndSize : fns.Initialize
fns.name=list1.Get(i)
fns.size=File.Size(File.DirInternal,"mydir/"&fns.name)
list2.Add(fns)
Next
list2.SortType("size",False)
For i=0 To list2.Size-1
Dim fns As NameAndSize=list2.Get(i)
Log("name:" & fns.name & " size:" &fns.size)
Next