I have some large files I need to process and would like to indicate to the user the file size as the processing may take a long time.
I am using David Heffernan's function (a BIG thanks there David) to get the size and it works just great.
function GetFileSize3(const FileName: string): Int64;
var
fad: TWin32FileAttributeData;
begin
if not GetFileAttributesEx(PChar(FileName), GetFileExInfoStandard, @fad) then
RaiseLastOSError;
Int64Rec(Result).Lo := fad.nFileSizeLow;
Int64Rec(Result).Hi := fad.nFileSizeHigh;
end;
I then convert that to a string and store it and others in a StringList for later use.
When I try to convert it back to an Int64 value (myInt64:=StrToInt(slSize[j])) I get an error, "xxx is not an Integer" or something very close to that error.
I guess I should have used an Array of Record with Filename:String; Size:Int64; etc in the Record instead of using StringLists. Hindsight is wonderful, and it would now take a major re-write to use an Array of Records at this point.
I need a cheater's way to convert the very large StringList values back to an Int64 for the few files that are going to be outside the normal StrToInt( function that causes the error.
Anyone care to save my bacon? Thank you.