Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Help storing large numeric values.


4 replies to this topic

mrothstein

mrothstein
  • Members
  • 5 posts

Posted 07 February 2004 - 00:08

I have an issue where I need to add the disk space sums of several large databases, and display the size to the user, to confirm weather or not they want these databases backed up or not. Problem is, that Installshield's NUMBER data type will only stopre values up to 2 GB, and their LONG datatype doesnt buy you anything more (why they even offer LONG when it is no differnt then NUMBER - I have not a clue, if it is not really LONG, DONT OFFER IT!) Anyway, does anyone have any clue at all how to store large numberic values in Installscript????

Thanks,
Mike



Perotin

Perotin
  • Full Members
  • 407 posts

Posted 09 February 2004 - 10:22

Do you have to display the number of BYTES?
You can easily use the number of KILOBYTES or MEGABYTES, that won't break the 2gig barrier of NUMBER/LONG/INT (which seems to be identical ...).
The function GetDiskSpaceEx should help you.
Gruß / regards
Thomas

mrothstein

mrothstein
  • Members
  • 5 posts

Posted 09 February 2004 - 20:21

GetDiskSpaceEx will tell you the amount of free space. I need a way to add up the file sizes for several differnt files togther and display the total size. This value may be larger then the 2 GB limit.

hteichert

hteichert
  • Members
  • 158 posts

Posted 10 February 2004 - 11:41

Then take the size of each individual file, divide it by 1024 and add the results. This will bring you to KBytes instead of Bytes and should solve the problem as long as each individual file is smaller than 2 GBytes
h.teichert-ott

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 10 February 2004 - 14:33

what about using the windows api?
kernel32.dll gives you GetFileSize, which returns a dword, see MSDN for more details
Gruß / regards
Thomas