Release 10.1A: OpenEdge Development:
Internationalizing Applications

> ## Using the 4GL

> Besides using the keyboard and possibly the mouse to enter multi-byte characters, you can also use the Progress 4GL.

> ##### Using the 4GL to simulate inputting double-byte characters

> To input a double-byte character using the 4GL, assemble the character using the `CHR` function, whose syntax is:

> Syntax
>     CHR ( expression
>           [ , target-codepage [ , source-codepage ] ]
>         )

> The following example creates and displays the double-byte character. It is from the KSC5601 code page, which supports Korean:

>     DEFINE VARIABLE Double-byte-char as CHAR.
>     Double-byte-character = CHR( (236 * 256) + 237 ).
>     DISPLAY Double-byte-char WITH 1 COLUMN.

> In the preceding example, the second line shifts the first value into the lead byte and adds the second value to the trail byte.

> Note: The preceding example assumes the internal code page (`-cpinternal`) is set to KSC5601.

> ##### Using the 4GL to simulate key presses and mouse clicks

> Besides using the Progress 4GL to simulate the input of characters, including multi-byte characters, you can also use the 4GL to simulate key presses and mouse clicks in a multi-byte environment.

> Table 8–2 describes the 4GL elements involved and the multi-byte support provided by each.

> Table 8–2: 4GL elements that simulate key presses and mouse clicks
> 4GL element | Description | Example | Multi-byte support
> --- | --- | --- | ---
> `APPLY` statement | Applies an event to a widget or a procedure. |
>     APPLY "CHOOSE" TO
>     order-amt IN
>     FRAME x.
> | The name of the event can contain multi-byte characters.
> `LASTKEY` function | Returns, as an integer, the key code of the most recent keyboard or mouse event. `LASTKEY` returns values only after the input method places the data into the keyboard buffer. |
>     IF LASTKEY =
>     KEYCODE("F9")...
> | The key sequence can be a multi-byte character.
> `READKEY` statement | Reads one keystroke from an input source and sets the value of `LASTKEY` to the keystroke’s keycode. |
>     READKEY.
> | The key sequence can be a multi-byte character.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095