* PASSWORD.CMD * * Called from operating programs by the command DO PASSWORD. * Hides pasword entry; sounds alarm when unauthorized * access attempted. Reset is the only escape. * * Variables: Password contains the authorized password. * Char is a counter to check each letter individually. * Counter repeats loop for each letter. It is used as * a character variable for the sake of macro substitution. * Test will collect each entry and compare it with the actual password. * SET BELL OFF SET COLON OFF SET CONSOLE OFF ERASE * Choose any term to be your password. The user must match it exactly, * including capitalization. STORE "BUDDY" to password @ 20, 5 SAY "Please Enter The Password ==>" * Initial values. The counter value will place the first password * entry after the prompt. STORE 0 to char STORE '36' to X DO WHILE char < len(password) STORE char + 1 to char STORE ' ' to test SET CONSOLE OFF @ 20, &X GET test READ CLEAR GETS SET CONSOLE ON @ 20, &X SAY '#' * Signal of inaccurate entry IF test <> $(password,char,1) SET CONSOLE ON DO WHILE t ERASE @ 12,10 SAY 'NOT AUTHORIZED TO USE THIS FILE' ? chr(7) @ 12,10 SAY ' ' ENDDO ELSE SET CONSOLE OFF STORE STR((val(X)+1),2) to X ENDIF ENDDO SET CONSOLE ON SET ESCAPE ON RELEASE password, char, counter, test RETURN inaccurate entry IF test <> $(password,char,1) SET CONSOLE ON DO WHILE t ERASE @ 12,10 SAY 'NOT AUTHORIZED TO USE THIS FILE' ? chr(7) @ 12,10 SAY ' ' ENDDO ELSE SET CONSOLE OFF STORE STR((val(x)