Convert Chars From a Sctring to Their ASCII Code?
Paul T.
Bacau, Romania

Aug 26, 2014
41 Posts

Convert chars from a sctring to their ASCII code?

Hi,

Is there a way to convert a char representation to its ASCII code? I know the chr(...) procedure, but I need something that does the opposite of it (receive a char and return its ASCII code). I am using ATEasy 7.


Thanks,

Alex

Nagib M.
Fleury-Les-Aubrais,

Aug 26, 2014
4 Posts

Re: Convert chars from a sctring to their ASCII code?

Hi,

You just need to cast a char variable to a short variable.
Char c
Short n

c = 'A'
n = c

!n is 65 now

The short variable will 'display' in the debug window the ascii value or you can use it as a numeric value in your code.

Regards

Solution Available
Paul T.
Bacau, Romania

Aug 26, 2014
41 Posts

Re: Convert chars from a sctring to their ASCII code?

Thank you very much, Nagib. Now I know the trick.



Best regards,

Alex



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]