Hello.
Is it possible in VBS macro modulo operation, hex to dec and dec to hex????
Mathematical operation in vb scripts
Re: Mathematical operation in vb scripts
Yes, all that is possible.
Modulo:
The result is 1.
hex -> dec conversion:
The result is FF.
dec -> hex conversion:
The result is in both cases 255.
Modulo:
Code: Select all
Dim A
A = 16 Mod 5
MsgBox A
hex -> dec conversion:
Code: Select all
Dim d
d = 255
MsgBox Hex(d)
dec -> hex conversion:
Code: Select all
Dim h
h = "&HFF"
MsgBox CInt(h)
h = &HFF
MsgBox h
Re: Mathematical operation in vb scripts
Hello,
thanks it's works.
I have second problem. I need write to ex. x=2 200 000 000. In this moment i have comunicate x overflow.
In my opinion the best solution is a change x to double but i don't how.
thanks it's works.
I have second problem. I need write to ex. x=2 200 000 000. In this moment i have comunicate x overflow.
In my opinion the best solution is a change x to double but i don't how.
Re: Mathematical operation in vb scripts
You can assign large values to VBS variables without errors and calculate something with it, the VBS scripting engine then internally works with floating point numbers (double). But many functions in VBS are limited to signed 32-bit integer values, the highest value of which is 2147483647.