Masking the Entry in a Password Field in QUICK

Technote (troubleshooting)


Problem(Abstract)

How can a password field be set up in a QUICK screen, so that the password is masked with asterisks (*)?

Product Version: PowerHouse 8.13D2
Build: 1000
Platform: HPUX

Resolving the problem

Use NOECHO to suppress the echo of value to screen. To have an asterisk (*) come up for each character, temporary fields must be used for each possible character. Code an Edit Procedure for each temporary to capture the entry and display an * in it's place. For example, the following screen contains an 8 character password field:

SCREEN x
FILE loginfile
TEMP t-pass1 CHAR*1
TEMP t-pass2 CHAR*1
TEMP t-pass3 CHAR*1
TEMP t-pass4 CHAR*1
TEMP t-pass5 CHAR*1
TEMP t-pass6 CHAR*1
TEMP t-pass7 CHAR*1
TEMP t-pass8 CHAR*1
TEMP t-pass CHAR*8

FIELD LOGIN OF LOGINFILE REQUIRED NOCHANGE
FIELD PASSWORD OF LOGINFILE silent
FIELD t-pass1 AUTONEXT LABEL "Password"
SKIP TO LINE 3
ALIGN(,,22)
FIELD t-pass2 AUTONEXT
SKIP TO LINE 3
ALIGN(,,23)
FIELD t-pass3 AUTONEXT
SKIP TO LINE 3
ALIGN(,,24)
FIELD t-pass4 AUTONEXT
SKIP TO LINE 3
ALIGN(,,25)
FIELD t-pass5 AUTONEXT
SKIP TO LINE 3
ALIGN(,,26)
FIELD t-pass6 AUTONEXT
SKIP TO LINE 3
ALIGN(,,27)
FIELD t-pass7 AUTONEXT
SKIP TO LINE 3
ALIGN(,,28)
FIELD t-pass8 AUTONEXT

PROCEDURE ENTRY
BEGIN
ACCEPT LOGIN OF LOGINFILE
ACCEPT T-PASS1
if 0 < size (trunc(t-pass))
then ACCEPT T-PASS2
if 1 < size(trunc(t-pass))
then ACCEPT T-PASS3
if 2 < size(trunc(t-pass))
then ACCEPT T-PASS4
if 3 < size(trunc(t-pass))
then ACCEPT T-PASS5
if 4 < size(trunc(t-pass))
then ACCEPT T-PASS6
if 5 < size(trunc(t-pass))
then ACCEPT T-PASS7
if 6 < size(trunc(t-pass))
then ACCEPT T-PASS8
let password of loginfile = t-pass
END

PROC EDIT t-pass1
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass1))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass2
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass2))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass3
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass3))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass4
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass4))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass5
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass5))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass6
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass6))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass7
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass7))
LET FIELDTEXT = "*"
END

PROC EDIT t-pass8
BEGIN
LET t-pass = PACK(TRUNC(t-pass) + TRUNC(t-pass8))
LET FIELDTEXT = "*"
END

Historical Number

98065

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Cognos Application Development Tools
PowerHouse

Software version:

PowerHouse 8.13.D2

Operating system(s):

HP-UX

Reference #:

1334171

Modified date:

2001-05-31

Translate my page

Machine Translation

Content navigation