Consultor Eletrônico



Kbase P18923: I18N. Making the Period Behave As a COMMA on Numeric Pad wit
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/07/2009
Status: Unverified

GOAL:

I18N. Making the Period Behave As a COMMA on Numeric Pad with GUI

FACT(s) (Environment):

Progress 9.x

CAUSE:

Because in some Locales, the decimal separator is a Comma ",", we need to implement this little workaround in way when the user press the Period "." in the Numeric Pad and to behave as if it was a comma.

FIX:

1. In all the decimal fill-ins add a trigger on any printable as follow.

ON ANY-PRINTABLE OF FILL-IN-1
DO:
  RUN CHANGETHEPERIOD.
END.

2. Create the following Procedure CHANGETHEPERIOD.

/*------------------------------------------------------------------------------

 Purpose:
 Parameters:  <none>
 Notes:
------------------------------------------------------------------------------*/

   IF KEYFUNCTION(LASTKEY) = "." THEN
       DO:
           IF SESSION:NUMERIC-FORMAT = "American" THEN RETURN.
           ELSE
               IF SESSION:NUMERIC-FORMAT = "European" THEN DO:
                       IF FOCUS:DATA-TYPE = "decimal" THEN DO:
                               APPLY KEYCODE(",").
                               RETURN NO-APPLY.
                       END.
               END.
    END.
END PROCEDURE.

This will when the user press a Period to be replaced on the fly by a comma.