How to do format String to int or Double

Yuval S.
Tel Aviv,

Dec 20, 2018
10 Posts

0  |  0  

Re: How to do format String to int or Double

Hi Guys,

Need assistance on how to format String to int / Double,

Lets say i want to convert Str("0X20") to Int or Double variable in order to comapre it  to a specific number,

any ideas ?

Thanks !

Solution Available
Cyril P.
Meung Sur Loire, France

Dec 20, 2018
23 Posts

1  |  0  

Re: How to do format String to int or Double

Hello,

if you want to convert String to value, use the Ateasy function Val(). (look in the help for more details)
So to convert your hexa string to value just type:
dValue=Val("0X20",16)
or
dValue=Val(sValue,16) assuming sValue is a string variable containing  an hexa value

Yuval S.
Tel Aviv,

Dec 20, 2018
10 Posts

0  |  0  

Re: How to do format String to int or Double

Thanks for the quick response, i'll try that...

Just for understanding it better , what "16" do actually ? is dValue will be now 20 (out of 0X20)?  


Thanks again !

Dale J.
La Verne, CA

Dec 20, 2018
22 Posts

0  |  0  

Re: How to do format String to int or Double

The"16" is the Radix to use in the conversion, i.e. hex (10 = decimal, 8 = octal, 2 = binary).  0x20 hex = 32 decimal.  dValue = 32



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]