how to combine 3 variables in one variable consecutively ?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Default how to combine 3 variables in one variable consecutively ?

    hello
    i am doing a timer but i want to combine 3 variable in one variable.
    for example :

    x var byte
    y var byte
    z var byte
    num var word

    x = 1
    y=2
    z = 3

    i want num = zyx

    i have a solution, but i am not satisfied to it. my solution is

    y=y*10
    z=z*100
    then
    num=x+y+z
    but i am thinking if i use For statement, then the number will multiply by 10 and 100

  2. #2
    Join Date
    Apr 2012
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: how to combine 3 variables in one variable consecutively ?

    what about this solution ?

    num = z*100 + y+10 + x

Members who have read this thread : 2

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