First off i was wondering if there was and easier way of masking the password fields on a login screen in version 9.1d i know there is for newer versions but not sure about our current version.
This is how we did it on a trigger
Also we are having trouble when it wont let you tab out of the password field is there any way to fix that?
This is how we did it on a trigger
Code:
DO.
CASE KEYFUNCTION(LASTKEY):
WHEN "DELETE-CHARACTER" THEN
DO:
/* Remove last char from password and last "*" from fill-in. */
IF LENGTH(pword) > 0 THEN
DO:
pword = SUBSTRING(pword,1,(LENGTH(pword) - 1)).
pwd:SCREEN-VALUE =
SUBSTRING(pwd:SCREEN-VALUE,1,
LENGTH(pwd:SCREEN-VALUE) - 1).
pwd:CURSOR-OFFSET = LENGTH(pwd:SCREEN-VALUE) + 1.
RETURN NO-APPLY.
END.
END.
WHEN "BACKSPACE" THEN
DO:
/* Remove last char from password and last "*" from fill-in. */
IF LENGTH(pword) > 0 THEN
DO:
pword = SUBSTRING(pword,1,(LENGTH(pword) - 1)).
pwd:SCREEN-VALUE =
SUBSTRING(pwd:SCREEN-VALUE,1,
LENGTH(pwd:SCREEN-VALUE) - 1).
pwd:CURSOR-OFFSET = LENGTH(pwd:SCREEN-VALUE) + 1.
RETURN NO-APPLY.
END.
END.
WHEN "RETURN" THEN DO:
/* User believes password is correct -- validate password. */
APPLY "entry" TO button-ok.
/* Your validation code here. */
RETURN NO-APPLY.
END.
WHEN "TAB" THEN DO:
/* User believes password is correct -- validate password. */
/* Your validation code here. */
RETURN NO-APPLY.
END.
WHEN "END-ERROR" THEN DO:
/* END-ERROR */
RETURN NO-APPLY.
END.
OTHERWISE DO:
/* check for printable character */
IF KEYCODE(KEYFUNCTION(LASTKEY)) > 0 AND
KEYCODE(KEYFUNCTION(LASTKEY)) < 200
THEN DO:
/* Build password from input & display "*" in fill-in. */
pword = pword + KEYFUNCTION(LASTKEY).
pwd:SCREEN-VALUE = pwd:SCREEN-VALUE + "*".
pwd:CURSOR-OFFSET = LENGTH(pwd:SCREEN-VALUE) + 1.
/* pwd:CURSOR-OFFSET = pwd:CURSOR-OFFSET + 2. */
RETURN NO-APPLY.
END.
ELSE RETURN NO-APPLY. /* ignore non-printables */
END.
END CASE.
END.