ASCII char to decmal value

G

Guest

I am reading values from a comm port and recieve individual ascii characters
including non-printing and extended ones. They span the entire range from dec
value 0 to 255. What I need to do is get the decimal value from either a byte
or char value. i.e. NUL will give 0, SOH - 1, STX - 2 .... A - 39, B - 40
etc... up to 255

Have tried the web but can't sem to find anything.

Cheers in advance.
 
C

Cor Ligthert

Hi,

Please will you be so kind not to multipost, crossposting is not any problem
in the dotnet and fox newsgroups. (Crossposting is sending one message to
more relevant newsgroups in one time and than we can all learn from the
answers).

I answered this question in the newsgroup dotnet general.

Cor
 
H

Herfried K. Wagner [MVP]

Director - Minvent said:
I am reading values from a comm port and recieve individual ascii
characters
including non-printing and extended ones. They span the entire range from
dec
value 0 to 255. What I need to do is get the decimal value from either a
byte
or char value. i.e. NUL will give 0, SOH - 1, STX - 2 .... A - 39, B - 40
etc... up to 255

In which format are these characters returned? Strings? 'Char's? 'Byte's?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top