Best way to join two variable in one


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Jun 2016
    Posts
    60

    Default Best way to join two variable in one

    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?
    Last edited by Alberto; - 27th January 2017 at 10:56.

Similar Threads

  1. Assigning a string variable to another string variable
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd June 2013, 17:55
  2. Variable within Variable
    By munromh in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th January 2009, 14:44
  3. Strings......and how to join them
    By gringobomba14 in forum General
    Replies: 17
    Last Post: - 22nd July 2008, 14:15
  4. One variable made up of another variable
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st September 2007, 00:18
  5. 2 variable
    By isaac in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th May 2004, 21:59

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts