How to reference variable bits in a loop


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    21

    Default How to reference variable bits in a loop

    I have a variable IRdata=%1010
    I want to be able to reference the individual bits of IRdata through a loop.

    I know that I can use Irdata.Bit1 (bit2, etc)
    I also Know that I can use IRdata & %0001

    I can't figure out how to reference the bits through a loop though
    eg:
    for n=1 to 4
    IRbit=Irdata.Bitn
    Next n


    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Please do a SEARCH on the forum...

    http://www.picbasic.co.uk/forum/showthread.php?t=544

  3. #3
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Does this help?
    Melanie's explaination

    -edit- Looks like she beat me to the punch
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  4. #4
    Join Date
    Feb 2006
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Thanks

    :-)

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Controlsystem for compact sporting (clay shooting)
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 30th July 2009, 16:48
  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. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

Members who have read this thread : 0

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