Shop OBEX P1 Docs P2 Docs Learn Events
Question about varables — Parallax Forums

Question about varables

average joeaverage joe Posts: 795
edited 2009-06-09 04:13 in BASIC Stamp
What's wrong with this code and how do I make it work? Also is it possible to refrence ins, outs or dirs with alias / modifiers? I am a hobby designer and Pbasic is my first programming language. Any help would be much appreciated!

Logic VAR Byte
Logic_A VAR logic.BIT0...BIT2
Logic_B VAR logic.BIT3...BIT4
Mute_A VAR logic.BIT5
Mute_B VAR logic.BIT6

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2009-06-07 03:29
    average joe

    Did You get this to TOKENIZE with the Editor???


    _____________$WMc%____

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • SRLMSRLM Posts: 5,045
    edited 2009-06-07 03:41
    Did you specify the language? Click on the little button that says 2.5 and it should insert some code for you.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-07 03:57
    I think you're ok with the individual bits, but I don't believe you can make aliases to groups of bits like 0..2 or 3..4.

    There already are names for portions of INS, DIRS, and OUTS. In particular, there are names for the two bytes of the 16 bit values and for the four nibbles as well as the individual bits. You can assign aliases to these names. See page 83 of the Stamp Syntax and Reference Manual.
  • average joeaverage joe Posts: 795
    edited 2009-06-07 10:47
    I've read the manual a couple times and it it says you can reference groups of bits with modifiers. But it says nothing about modifying predefined names. Attached is code that has tested ok, but I was hoping to streamline it a bit. I havn't had a chance to finish the schematic or comment code but will hopefully have this done in a shortly.
  • average joeaverage joe Posts: 795
    edited 2009-06-09 04:13
    So no one has any information on how to use variables better? I keep reading the syntax reference and can't see anything explaining this better
Sign In or Register to comment.