working with Big, Big Numbers..
I am working with numbers (or rather disk sizes in bytes) such as:
39991275520
As soon as I use this number, MMF changes it into a strange negative decimal number .. How can I store and use big numbers such as the one above? I would like to do the following expression:
39991275520/1048576
this is a simple expression that converts bytes to Megabytes...
Any ideas?
Thanks guys!
-Mel ;)
Re: working with Big, Big Numbers..
Try the LUA or expression evaluator objects.
Re: working with Big, Big Numbers..
Isn't there a big int extension.. Int64? I don't remember but I think there is.
Re: working with Big, Big Numbers..
Hi guys, thanks for the suggestions so far..
I tried the all suggestions (Except LUA) and I got a 0 as the result .. By the way, I'm getting the value from Sphax's Kernal object .. The 'Free Disk Space' expression ..
can anyone get around this? Maybe Sphax can help?
-Mel
Re: working with Big, Big Numbers..
It works for me with INT64 Object.
Code:
Start of frame:
INT64->Set stored number "39991275520"
INT64->Divide "1048576"
STRING->Set text Stored$( "Int64 object" )
Result = 38138
Re: working with Big, Big Numbers..
Works fine for me when I use the Int64 object.
Set your stored number as "39991275520", divide by "1048576" and then set a string to Stored$( "Int64 object" ).
Or if you want to set a counter to that value, set it to Val(Stored$( "Int64 object" ))
Edit: Villy beat me to it :(
Re: working with Big, Big Numbers..
Hi guys!
Yeh it works when you have a number like that, but my problem continues as I'm dynamically getting the number from Sphax's Kernal object..
Try using the Kernal object's 'getDiskFreeSpace( "Kernel object", >Path<)' expression and see for yourselves.. Can you guys get it to work that way?
Thanks!
-Mel
Re: working with Big, Big Numbers..
BTW ..
I'm doing this...
Div$( "Int64 object", Str$(getDiskFreeSpace( "Kernel object", Appdrive$)), "1048576")
This in theory should work, as it's converting the number of bytes of C: into megabytes .. I'm still getting 0..
Re: working with Big, Big Numbers..
LUA code:
Code:
function Divide(Oper1,Oper2)
return Oper1/Oper2;
end
MMF events:
* Upon pressing button 1
- LUA: Call function "Divide" with params: Str$(getDiskFreeSpace( "Kernel object", Appdrive$))+"|1048576" [return count 1]
- Edit Box: Set value to LuaStrRet( "Lua object", 0)
Re: working with Big, Big Numbers..
Hi Joshtek! Thanks for posting ..
LUA is returning a negative number which implies to me that possibly the information coming from the kernal object is incorrect..
Can anyone else verify this? Is it returning the amount of free space in megabytes? right click on your C drive and hit properties.. It should be the same there..
-Mel