Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4787

Best way to join two variable in one

$
0
0
I am downloading some data from a cloud, collecting the ascii characters in a byte array. Now I need to use some of the numbers received, so I have to move them into a word variable.

What I am doing at the moment is:

W0 = ((b0-48)*100) + ((b1-48)*10) + (b2-48)

Where:

b0 = "6"
b1 = "5"
b2 = "3"

W = 653

Is there a better way to covert ascii to number?


Alberto

Edited:
Why the thread title cannot be edited?

Viewing all articles
Browse latest Browse all 4787

Trending Articles