Consultor Eletrônico



Kbase P148729: 4GL/ABL: How to allow a user to enter the question mark character as the first character in a fill i
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/06/2009
Status: Unverified

GOAL:

4GL/ABL: How to allow a user to enter the question mark character as the first character in a fill in field?

GOAL:

How to enter the question mark character '?' as the first character in a fill-in widget?

FACT(s) (Environment):

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

FIX:

One way to allow the user enter a question mark as the first letter in a FILL-IN widget is to create an ANY-PRINTABLE event trigger for the FILL-IN widget in question using code along the following lines:

ON ANY-PRINTABLE OF FILL-IN-1 IN FRAME DEFAULT-FRAME
DO:
IF SELF:SCREEN-VALUE = "?" THEN DO:
ASSIGN
SELF:SCREEN-VALUE = SELF:SCREEN-VALUE + LAST-EVENT:FUNCTION
SELF:CURSOR-OFFSET = 3.
RETURN NO-APPLY.
END.
END.
Note that the above code alone will allow the user to enter the question mark as the first character in a fill-in widget, however, will not allow the user to delete the first character question mark using the BACKSPACE. To allow the use of the BACKSPACE character to delete the first question mark character, create a BACKSPACE event trigger with the following code:
ON BACKSPACE OF FILL-IN-1 IN FRAME DEFAULT-FRAME /* Fill 1 */
DO:
IF SELF:SCREEN-VALUE = "?" AND LASTKEY = 8 THEN
SELF:SCREEN-VALUE ="".
END.