Return to the RPG Tips
Masking a password
>Is there a way on the 400 to mask a password with astericks? Not a user >profile password, but rather from a DDS screen. > >Its easy enough to use DSPATR(ND) to inhibit the character echo, but there >must be a technique to echo astericks. One other way is to use the following technique: Display file source A R PSWDS1 A*%%TS SD 20000803 141725 MIKE REL-V4R4M0 5769-PW1 A CF03 A CF07 A 7 22'Password' A ASTERISK 10A O 7 32 A ENTRYCHAR 1A B 7 44DSPATR(ND) A CHECK(ER) A 23 2'F3=Exit' A COLOR(BLU) A 23 11'F7=Clear Password' A COLOR(BLU) RPGLE source Fpswds CF E WORKSTN C* C *like define asterisk password C* C DspS1 tag C clear entrychar C clear asterisk C clear password C* C ErrS1 tag C clear entrychar C EXFMT pswds1 C* F7=re-set C *inkg Cabeq *on DspS1 C* F3=exit C *inkc Cabeq *on Exit C* If blank, assume Enter pressed C if entrychar = *blanks C* Nothing entered C password cabeq *blanks ErrS1 C else C cat '*':0 asterisk C cat entrychar:0 password C goto ErrS1 C endif C C* check password C password cabne 'ACTUALONE' DspS1 C* C* C Exit Tag C Eval *inlr = *on
[report a broken link by clicking here]