Array to simple Variable converting


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    19

    Default Array to simple Variable converting

    Hi!

    How can I convert a binary array to a simple variable?

    temp var bit[10]
    temp2 var word

    temp[0]=1
    temp[1]=1
    temp[2]=0
    temp[3]=0
    temp[4]=1
    temp[5]=0
    temp[6]=1
    temp[7]=0
    temp[8]=1
    temp[9]=0

    I want to temp2=%1100101010 (%0000001100101010)

    I tried like this:

    counter var byte
    counter=0

    Repeat
    temp2.counter = temp[counter]
    counter=counter+1
    Until counter=10 '9+1

    But its fails on temp2.counter.
    Please help.
    Thx

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Sep 2005
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Thank you!

Similar Threads

  1. EEPROM Variables (EE_Vars.pbp)
    By Darrel Taylor in forum Code Examples
    Replies: 79
    Last Post: - 26th October 2012, 00:06
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. How to saparate variable to array and GLCD Question
    By pramarn in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 4th October 2006, 03:42
  5. display lcd variable array Ascii
    By volcane in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd November 2005, 21:36

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