Kbase 20262: 4GL. How To Display Blanks While Updating Password Field
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/9/2007 |
|
Status: Unverified
GOAL:
4GL. How to use the BLANK option in Progress 4GL to hide the keystrokes you enter into a fill-in.
FIX:
In some cases, you might want to display asterisks, in others, blanks.
Either option helps you to know how many characters you have entered. In the case of a typo, for example, you can hit the backspace or delete keys to edit your current input.
The Progress 4GL supports this functionality with the BLANK option. The BLANK option is used in a variable or field definition, or in a fields format phrase during frame definition or display.
The following example shows how to use the BLANK option:
DEFINE VARIABLE hWin AS HANDLE NO-UNDO.
DEFINE VARIABLE cPassword AS CHARACTER FORMAT "x(25)":U
NO-UNDO LABEL "Password" VIEW-AS FILL-IN SIZE 25 BY 1.
DEFINE VARIABLE cUserID AS CHARACTER FORMAT "x(25)":U
NO-UNDO LABEL "User ID" VIEW-AS FILL-IN SIZE 25 BY 1.
DEFINE BUTTON btOK LABEL "OK" SIZE 14.1 BY 1 AUTO-GO.
DEFINE BUTTON btCancel LABEL "Cancel" SIZE 14.1 BY 1.
CREATE WINDOW hWin.
ASSIGN hWin:MESSAGE-AREA = FALSE
hWin:STATUS-AREA = FALSE
CURRENT-WINDOW = hWin
hWin:THREE-D = TRUE
hWin:TITLE = "Login to my Application ..." NO-ERROR.
DEFINE FRAME loginFrame cUserId COLON 15 btOK AT 45 SKIP(.4)
cPassword BLANK COLON 15 btCancel AT 45
WITH SIDE-LABELS THREE-D NO-BOX.
ASSIGN FRAME loginFrame:Y = ( SESSION:PIXELS-PER-COLUMN * 2 )
hWin:HEIGHT = FRAME loginFrame:HEIGHT + 1
hWin:WIDTH = FRAME loginFrame:WIDTH + 1 NO-ERROR.
DISPLAY cUserID btOK cPassword btCancel WITH FRAME loginFrame.
ENABLE cUserID cPassword btOK btCancel WITH FRAME loginFrame.
ON 'ESC':U ANYWHERE
DO:
RETURN NO-APPLY.
END.
ON 'WINDOW-CLOSE':U OF CURRENT-WINDOW
DO:
APPLY 'CLOSE':U TO THIS-PROCEDURE.
RETURN.
END.
ON 'CLOSE':U OF THIS-PROCEDURE
DO:
QUIT.
RETURN.
END.
ON 'CHOOSE':U OF btCancel
DO:
APPLY 'CLOSE':U TO THIS-PROCEDURE.
END.
ON 'GO':U OF FRAME loginFrame
DO:
ASSIGN cPassword.
/* Authenticate password here... */
MESSAGE "Successfully logged into my Application".
APPLY 'CLOSE':U TO THIS-PROCEDURE.
END.
ON 'RETURN':U OF cPassword
DO:
APPLY 'GO':U TO FRAME loginFrame.
END.
WAIT-FOR GO OF FRAME loginFrame.
NOTE: For an example of how to use asterisks rather than spaces, see Progress Solution P18033.