I've thought of that but the writing to text file can occur multiple times and I would rather not fiddle with that part of the program. I really just want to get the items in the Files array in the correct order the quicket possible way.
 
For those interested, this seems to work very well.  Files is a global array of FileRec.  TempFiles is a local array of FileRec.
 
for FileCnt := 0 to High(Files) do
  FileList.AddObject(ExtractFilename(Files[FileCnt].Filename),TObject(FileCnt));
FileList.Sort;
SetLength(TempFiles,Length(Files));
for FileCnt := 0 to High(TempFiles) do
  TempFiles[FileCnt] := Files[Integer(FileList.Objects[FileCnt])];
CopyMemory(Files,TempFiles,Sizeof(FileRec)*FileCnt);
 
 
Cheers,
Ross.
----- Original Message -----
Sent: Thursday, May 27, 2004 10:48 AM
Subject: Re: [DUG] dynamic array items

What about a TList - the TList containing pointers to the already-allocated records and you just resort the pointers and then write to file the records contained at the pointer location using the TList order.
 
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to