Consultor Eletrônico



Kbase P127805: 4GL/ABL: How to restrict user input in a 4GL/ABL application to a specific subset of ACSII character
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/21/2007
Status: Unverified

GOAL:

4GL/ABL: How to restrict user input in a 4GL/ABL application to a specific subset of ACSII characters?

FACT(s) (Environment):

OpenEdge Category: Language (4GL/ABL)
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

Write an "ANY-KEY" session trigger in the startup procedure of the application to reject any input from outside the desired subset of ASCII characters. For example, the following session trigger will reject any user input that is not in the subset of capital letters {A,B,...,Z}:
ON 'ANY-KEY':U ANYWHERE
DO:
IF LASTKEY < 65 OR LASTKEY > 90 THEN DO:
MESSAGE "Illegal input character...Please try again!"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN NO-APPLY.
END.
END.