Shop OBEX P1 Docs P2 Docs Learn Events
Password Checker — Parallax Forums

Password Checker

bslack109bslack109 Posts: 5
edited 2025-03-05 07:04 in BASIC Stamp

I have typed this in from the old manual.
I cannot get it to work.
It downloads without errors.

' {$STAMP BS2}
' {$PBASIC 2.5}
'PasswordChecker.bs2
'Check password entered in Debug Terminal's Windowpane.


Password  DATA  "pass!"

index     VAR Nib
temp      VAR Byte
userEntry VAR   Byte(5)

DO
DEBUG "Enter password: "
DEBUGIN STR userEntry \5

FOR index = 0 TO 4
  READ Password + index, temp
  IF temp <> userEntry(index) THEN EXIT
  NEXT

  IF index <> 5 THEN

    DEBUG CR, "Password not correct. ",CR
  ENDIF

LOOP UNTIL index = 5
DEBUG CR, "Password is correct;", CR, "program can continue..."
END

Comments

Sign In or Register to comment.