| View previous topic :: View next topic |
| Author |
Message |
MondoNuovo Valued Newbie
Joined: 09 Jul 2001 Posts: 44 Location: Italy
|
Posted: Wed Jun 19, 2002 5:53 pm Post subject: Folder Size? |
|
|
Hi all,
I wanted to know whether making VDS read the dimensions of a folder is possible?
Thanks
Daniele |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
|
| Back to top |
|
 |
MondoNuovo Valued Newbie
Joined: 09 Jul 2001 Posts: 44 Location: Italy
|
Posted: Wed Jun 19, 2002 6:30 pm Post subject: |
|
|
| Thanks Dr. Dread!! |
|
| Back to top |
|
 |
DanTheMan Contributor


Joined: 15 Mar 2002 Posts: 56 Location: Sweden
|
Posted: Wed Jun 19, 2002 8:42 pm Post subject: |
|
|
Hi folks!
Found a bug i Mac:s program, on Line 251. There might be a problem
when running on very large directories. @div() command get an Error 25
when (%%bytes) get over 999999999 bytes. Not Mac:s fault but
right now we can fix it with a dirty one.
change Line 251: %%bytes = @div(%%bytes, 1000)
to: %%bytes = @substr(%%bytes,1,-3)
Thanks Mac for your nice piece of code, it's a little bit slow but it's
works fine.!
/Dan |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Jun 19, 2002 10:35 pm Post subject: |
|
|
Thanks Dan,
I changed the posted code to include your fix.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Jun 20, 2002 5:50 am Post subject: |
|
|
I think the floating point functions of VDS can handle larger values, so maybe try @FDIV().
Tommy |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Jun 21, 2002 1:21 am Post subject: |
|
|
You're correct (as usual) Tommy,
@fdiv() will handle much larger values, but using
"@format(%%bytes, .0)" rounds them instead of just
removing the fraction. I used @div() to avoid this,
because rounding upward with several figures could
result in more bytes than the drive size (if it's nearly
full)...
______________________________________________________________________________________________________________________________________________________
| Code: |
rem -- 15 digits --
%%bytes = 999999999999999
if @greater(%%bytes, 999)
%%bytes1 = @fdiv(%%bytes, 1000)" (15 digits plus a period)"
%%bytes2 = @format(@fdiv(%%bytes, 1000), .0)" (rounds to 13 digits)"
%%bytes3 = @substr(%%bytes,1,-3)" (fraction removed to 12 digits)"@tab()
else
%%bytes = @fdiv(%%bytes, 1000)
end
INFO BYTES= %%bytes" (15 digits)"@cr()@cr()FDIV= %%bytes1@cr()@cr()Formatted FDIV= %%bytes2@cr()@cr()SUBSTR= %%bytes3
|
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
|