Upper-case or lower-case text - specifying on forms


This article describes how to ensure that certain fields on a form accept only upper or lower-case text, without modifying the program.


The default behavior on a screen form is to type data in the form using lower-case and upper-case text at the same time. In some cases, it is necessary to force the use of upper-case (or lower-case) only.


Adding the UPPER (or LOWER) property to the definition of a screen control is one method of accomplishing this. However, this requires the program to be recompiled.

An alternative solution that does not require compiling is to configure several environment variables.

For character screens, use this environment variable:

KEYBOARD case=lower


KEYBOARD case=upper

For graphical screens, the KEYSTROKE environment variable allows you to remap lower-case to upper-case, or vice versa.

For example:

KEYSTROKE data=65 97    <- this will transform the edited 'a' in 'A'
KEYSTROKE data=66 98 <- this will transform the edited 'b' in 'B'
KEYSTROKE data=67 99 <- this will transform the edited 'c' in 'C'

and so on, following the ASCII table.

To have only lower case, data must be inverted:

KEYSTROKE data=97 65    <- this will transform the edited 'A' in 'a'

Incident Number: 2261080

Old KB# 14117
Comment List
Related Discussions