PASSWORD(<expC>)
Stores a password so that it cannot be read.
Returns <expN> in the range from eight to ten digits.

<expC> may contain spaces and non-alpha characters.
Distinguishes between uppercase and lowercase.

Returns zero if <expC> is less than 3 characters.

Useful in applications that require one or more levels
of password protection.

<expN> cannot be decoded to reveal the <expC> that created it.

* User enters password
pass_word = SPACE(20)
SET COLOR TO w, x && invisible
@...SAY "Enter your password" GET pass_word
READ
SET COLOR TO w, i && normal
pass_word = PASSWORD( pass_word )

* Store a user's first time entry in a
* file with one field: pw_code, N, 10, 0
USE Passfile
APPEND BLANK
REPLACE pw_code WITH pass_word
USE && close files when no longer needed

* Validate a user's subsequent password entry
USE Passfile
LOCATE FOR pw_code = pass_word
is_found = FOUND()
USE && close files when no longer needed
IF .NOT. is_found
? "Error -- invalid password"
RETURN
ELSE
DO <system entry procedure>
ENDIF


Placed in the Public Domain by Tom Rettig Assoc.