Shop OBEX P1 Docs P2 Docs Learn Events
A bright idea ? — Parallax Forums

A bright idea ?

NavNav Posts: 23
edited 2004-11-09 15:48 in BASIC Stamp
I've got Version 2.1 of PBasic Editor running under Windows XP.

When I create a subroutine with the name 'bright' the editor seems to mistake it for a reserved word.· It changes 'bright' to 'BRIGHT' and colours it Magenta.· According to the preferences in the Editor, it seems that 'bright' is being recognised a Predefined Constant or Predefined Variable.· I was using the word as a subroutine name in a program for the MAX7219.

If you just carry regardless and do a Syntax Check on the program the word 'bright' is highlighted and·you get an error message saying "Expected a Label, Variable or Instruction".· I'm just curious as to the reason for this.· Sorry for the lame pun in the heading. [noparse]:)[/noparse]

·

Comments

  • Lee HarkerLee Harker Posts: 104
    edited 2004-11-08 19:53
    Nav,
    You might want to check out the help file. It appears that BRIGHT is a reserved constant used with the X10 commands as in DIM & BRIGHT.

    Lee
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2004-11-08 19:59
    Nav -

    Lee is indeed correct. You can find all of the reserved words in Appendix B of the Parallax PBASIC Stamp Manual.

    Regards,

    Bruce Bates
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-08 20:29
    First, don't use keywords for labels. It's just confusing. I *know* you didn't know 'bright' was a keyword, but now you do.
    Second, you *should* be able to use something like 'MyBright', 'FullBright', 'GoBright', 'LightBright', or similar.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-08 21:12
    The lesson here is that if the 2.1 editor colors a word, that word is either a PBASIC keyword or a predefined constant.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NavNav Posts: 23
    edited 2004-11-09 15:48
    Yup, had a look in Appendix B of the Basic Stamp Manual and there it is.
    Thanks for your responses, guys.
Sign In or Register to comment.