Shop OBEX P1 Docs P2 Docs Learn Events
Help with for...next — Parallax Forums

Help with for...next

MikeSMikeS Posts: 131
edited 2005-12-13 18:58 in BASIC Stamp
Seasons Greetings,
Attached is a program that I wrote to interface a BS2 with a serial keypad (0-9, ABCDEF#*). The keypad works fine. I want·the·user to enter a 5 digit password that matches the one stored in EEPROM to continue. The program is waiting for the fifth digit to be entered but is·ignoring it and only looks at the first four. I am assuming that I am doing something wrong inside the For... Next loop but I can not see what it is. Any help would be appreciated.
MikeS

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-12-13 18:44
    Perhaps it's because Byte array indexes start with zero, not 1.

    So, your "For indx = 1 to 5" is skipping the zeroth character, and running off the end of the array for the fifth character.
  • MikeSMikeS Posts: 131
    edited 2005-12-13 18:58
    allanlane5,

    That was it.

    Thank you very much.

    MikeS
Sign In or Register to comment.