Accessing the variable bits


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Posts
    6

    Default Accessing the variable bits

    Hi,

    I migrated from PicBasic to PicBasicPro and I found this code stops running well.

    MR var word: H var byte

    for H=0 to 15
    MR.0[H]=1 'set bit H of MR
    next H

    I supose this code sets to 1 all bits of MR but not works.

    Any ideas?

    Many thanks,

    Ricard.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Accessing the variable bits

    Try MR var bit[16]
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Mar 2011
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Accessing the variable bits

    Thanks Joe,

    I mean to read single bits I can use MR[bit] instead of MR.0[bit]??

    Also, I can keep using this variable as a Word? I mean for example if I can assign this bit variable to a word variable:

    W var word
    MR=W


    Can I do that?

    Many thanks,

    Ricard.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Accessing the variable bits

    Last edited by Archangel; - 27th March 2011 at 07:50. Reason: add link
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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