Is Int64 data type supported in Scripter Studio?

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

64-bit values are normally supported in TMS Scripter.

The reported problem was indeed a wrong implementation of DiskFree and DiskSize procedures, which were indeed returning the value truncated to 32-bit.

Problem has been fixed internally and next release will include the correction.

Thanks for the quick feedback on the problem, Wagner. I'll keep a look out for that next release.

Cheers,

Jason

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.