How to make a division?

Discuss RoboTask here
Post Reply
Alejandro
Posts: 7
Joined: Tue Jan 23, 2007 6:28 pm

How to make a division?

Post by Alejandro »

I made a task to determinate the total HDD usage, but it gives me bytes, I want to convert it to gb's... where may I make a division of a value??? in this case {TOTAL_SIZE}/1073741824I searched the forum and the online help without success...
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to make a division?

Post by Oleg »

There is Evaluate action for this purpose. This is in additional BASIC plugin. Just download here and install it.
BASIC plugin contain two actions:
Evaluate - for evaluating any mathematic expressions
BASIC script - for writing small subprograms on BASIC language
Alejandro
Posts: 7
Joined: Tue Jan 23, 2007 6:28 pm

How to make a division?

Post by Alejandro »

The more I use this thing the more I love it :)I'll try it. Thank you...
Alejandro
Posts: 7
Joined: Tue Jan 23, 2007 6:28 pm

How to make a division?

Post by Alejandro »

It worked... but I get the "error in expression" messsage... I tried several ways until I realized that i'ts because the size of the numbers... is the disk space in bytes (about 40,000,000,000) if I reduce the number to 400,000,000 (nine digits) it works...I can show numbers bigger than 9 digits, but I can't make operations with them (in this case a division) is this normal??? Is there a way to fix it???Thank you...
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to make a division?

Post by Oleg »

Try to use the expression {TOTAL_SIZE}#/1073741824
Symbol '#' says to BASIC that {TOTAL_SIZE} is a double value (a floating point )not an integer. DOUBLE have more large range of values. By default Basic think that {TOTAL_SIZE} is an integer value. This is small trick to avoid an error.

Also you may write so: {TOTAL_SIZE}.0/1073741824
Alejandro
Posts: 7
Joined: Tue Jan 23, 2007 6:28 pm

How to make a division?

Post by Alejandro »

duh :)Now working fine.Thank you...!
Post Reply