Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: FileSizeEx and integer math
When I do this:
FILE_SIZES=FileSizeEx(strcat(CD_PATH,"*.*")) FREE_SPACE=2851000000-FILE_SIZES DISP_SIZE=((FILE_SIZES / 1000) / 1000) DISP_SIZE=strcat(DISP_SIZE," MB") ========================================FREE_SPACE returns a positive number.
the FILE_SIZES is actually 704 mb
704318023
However, if I go over 2.85 gig minus File_Sizes, it returns a negative number.
FREE_SPACE=2900000000-FILE_SIZES
returns -2099285319
What am I missing here ?
Simple fix...Add the Decimals(0) and the .0 to your big number.
And you might want to change your divisor as indicated to match windows.
Decimals(0) FILE_SIZES=FileSizeEx(strcat(CD_PATH,"*.*")) FREE_SPACE=2851000000.0-FILE_SIZES DISP_SIZE=((FILE_SIZES / 1000) / 1024) DISP_SIZE=strcat(DISP_SIZE," MB")So basically use a real instead of an int.
Article ID: W15150
File Created: 2002:09:05:13:50:06
Last Updated: 2002:09:05:13:50:06