Hi, I'd like some help understanding how to work with Int64 in Scripter Studio. In this specific example, I'm attempting to obtain the sizes and free space available on all drives on the Windows box the script is running on using the "DiskSize" and "DiskFree" procedures in the standard Delphi System library. Here's the code:
procedure ShowDiskStats;
var
Loop: Byte;
DSize, DFree: Int64;
begin
for Loop := 3 to 26 do //byte value of drive "C" to "Z"
begin
DSize := DiskSize(Loop);
if DSize <> -1 then
begin
DFree := DiskFree(Loop);
ShowMessage(Format('Volume: %s / Size: %d / Free: %d', [Chr(Loop + 64), DSize, DFree]));
end;
end;
end;
Upon executing the above code, the resulting values appear to be mangled due to an improper type conversion, likely to the default 32 bit integer type:
Is there a preferred approach to deal with Int64 values in Scripter?
Jason