You are not logged in.
Stefan wrote:What output does WideFileSize(FilePath) provide? What means minus -1355529216?
As SafetyCar has suggested it is due to the limit of Integer type. However, WideFileSize function returns Int64 type - which can hold a value up to 9,223,372,036,854,775,807. It is IntToStr function which type casts Int64 to Integer.
To convert Int64 to string you can type cast it to Double and use FormatFloat('0', Int64) or FloatToStr.
Just to sum up for the learning effect:
So I was wrong with
dSize:Double;
dSize := WideFileSize(FilePath);
sSize := FormatFloat(FLOAT_FORMAT, dSize);
That should have been
i64Size:Int64;
i64Size := WideFileSize(FilePath);
sSize := FormatFloat(FLOAT_FORMAT, i64Size);
since WideFileSize() returns Int64
and I can chage (type cast?) it to Double by using FormatFloat('0', Int64) or FloatToStr.
(I was assuming that "float" commands works with decimal point numbers only (float to str), hence the use of Double at first.)
(Wiki for FormatFloat() and FloatToStr() reads: "Converts supplied floating point value ..."
but should, as far as I understand now, be "Converts supplied floating point or integer value ..." ??? Or smtg like that.)
And IntToStr function will change (type casts) Int64 to Integer. That's why I get this minus signed numbers. Out of range.
.
Last edited by Stefan (2013-06-28 07:26)
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
den4b wrote:I've also added to the TODO list:
Add File_SizeGB and File_SizeAuto meta tags.
When adding those tags you can add Size GB and SizeAuto into columns of files table
I hope that these features will be added soon
TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!
Offline
I hope that these features will be added soon
In the next version
Offline
Thanks
TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!
Offline