I am using the following code to populate a list view with the contents of a folder on windows and IOS.
procedure TTabbedForm.btnGetQuotesClick(Sender: TObject);
var
LList: TStringDynArray;
i : Integer;
LItem : TlistViewItem;
windowsDir,AppPath : String;
begin
ListBox1.Items.Clear;
ListView1.Items.Clear;
{$IF DEFINED(MSWINDOWS)}
windowsDir := TDirectory.GetCurrentDirectory;
LList := TDirectory.GetFiles(windowsDir+'\quotes','*.txt');
for i := 0 to Length(LList) - 1 do
begin
ListBox1.Items.Add(LList[i]) ;
LItem := listView1.Items.Add;
LItem.Text := LList[i];
end;
{$ENDIF}
{$IF DEFINED(iOS) or DEFINED(ANDROID)}
AppPath := TPath.GetDocumentsPath + PathDelim;
LList := TDirectory.GetFiles(AppPath,'*.txt');
for i := 0 to Length(LList) - 1 do
begin
ListBox1.Items.Add(LList[i]) ;
LItem := listView1.Items.Add;
LItem.Text := LList[i];
end;
{$ENDIF}
end;
I now need to sort the list in timestamp order / ascending and descending.
Thanks in advance.