Progress
Internationalization Guide


Progress 4GL

Table A–5 describes the Progress 4GL elements particularly useful for internationalizing and localizing applications.

Table A–5: 4GL Elements That Support Internationalization and
Localization
4GL Element
Description
ASC Function
Returns the value that a character has in the code page that Progress uses (default or the code page that -cpinternal specified). You can also specify a target and source code page, so that ASC converts the value a character has in the source code page to the value it has in the target code page before returning it.
CAPS Function
Changes any lowercase letters in a character string to uppercase. To do this, Progress uses a case table. Any double-byte characters in the string are not changed.
CHR Function
Returns the character that an integer represents in the code page that Progress uses (default or the code page that -cpinternal specified). You can also specify a target and source code page, so that CHR compares the value in the source code page and returns the character that the value represents in the target code page.

NOTE: Do not use the CHR function for sorting. The code-page value of a character is not the same as its sort weight. The sort weight of a character resides in a collation table for the code page.

CODEPAGE–CONVERT
Function
Converts a string value from one code page into another.
COLLATE Option of the FOR Statement, the OPEN QUERY Statement, and the PRESELECT Phrase
Computes the collation value of a string using one of several methods ("RAW," "CASE-SENSITIVE," "CASE-INSENSITIVE," or "CAPS") and the collation table you specify.
COMPARE Function
Compares two strings, using one of several methods ("RAW," "CASE-SENSITIVE," "CASE-INSENSITIVE," or "CAPS") and the collation table you specify.
COMPILE Statement
LANGUAGES Option
Specifies for which languages to generate text segments in r-code. At compilation, Progress reads translated strings from the translation databases that you provide. The r-code has a text segment for each language.
CURRENT–LANGUAGE
Function
Returns the value of the CURRENT–LANGUAGE variable.
CURRENT–LANGUAGE
Statement
Sets the CURRENT–LANGUAGE variable with a string expression for the current Progress session.
DBCODEPAGE Function
Returns the code page that a connected database uses.
DBCOLLATION Function
Returns the name of the collation table that a connected database uses.
ENCODE Function
Encodes a character string. The string can contain multi-byte characters.
GET–CODEPAGES Function
Returns the list of code pages in the convmap.cp file that the current Progress session uses.
GET–COLLATIONS Function
Returns the list of collation tables in the convmap.cp file that the current Progress session uses.
LC Function
Changes any uppercase letters in a character string to lowercase. Progress uses a case table for this operation.
NUMERIC–DECIMAL–
POINT Attribute of the
SESSION System Handle
The character that separates the integer portion and the fractional portion of a decimal value.
NUMERIC–FORMAT Attribute of the
SESSION System Handle
AMERICAN, EUROPEAN, or a character string consisting of the thousands separator followed by the fractional separator.
NUMERIC–SEPARATOR Attribute of the
SESSION System Handle
The character that separates each group of three digits in a number.
RCODE–INFO Handle
The RCODE–INFO handle has two useful attributes for international applications: CODEPAGE, which returns the code page with which the r-code is labelled (that is, the -cpinternal value when the r-code was compiled), and LANGUAGES, which returns the languages for which there are text segments.
SESSION Handle
The SESSION handle has many attributes that indicate code-page setting and the numeric and date formats that the current Progress session uses.
SET–NUMERIC–FORMAT Method of the SESSION System Handle
Sets the NUMERIC–SEPARATOR and NUMERIC–DECIMAL attributes to arbitrary values simultaneously.

Table A–6 describes the 4GL elements that support multi-byte characters.

Table A–6: 4GL Elements That Support Multi-byte Characters
4GL Element
Description
APPLY Statement
Performs the function of a specified key. The expression you APPLY can contain multi-byte characters.
ASC Function
For a double-byte character, returns a value greater than 255 and less than 65536.
For a multi-byte character, returns a value up to 1571291 (HEX: 0xEFBFBF).
BEGINS Operator
Tests a character expression to see whether it begins with a second character expression. Both expressions can contain multi-byte characters.
CAPS Function
Changes any lowercase letters in a character string to uppercase. Any double-byte characters in the string are not changed.
CHR Function
For a value greater than 255 and less than 65536, checks for a lead-byte value. If the lead byte is valid, Progress creates and returns a double-byte character.
Returns a character if the integer value you specify is within the range of 0 to 15712191. The function returns a null string if the integer value is outside this range, or if the value does not correspond to valid lead bytes or trail bytes.
ENCODE Function
Encodes a source character string and returns the encoded character string result. The source string can contain multi-byte characters.
NOTE: If the ENCODE function processes a string under one code page and then processes the same string under a different code page, the results might not match. For more information, see the Progress Language Reference .

ENTRY Function
Returns a character string entry from a character-delimited list based on an integer position. The string can contain multi-byte characters since ENTRY determines the location based on a unit of measure in characters.
ENTRY Statement
Sets an element in a character-delimited list of strings to a value. All strings and character separators can contain multi-byte characters.
FILL Function
Generates a character string made up of a character string repeated a number of times. Both strings can contain multi-byte characters.
INDEX Function
Returns an integer that indicates the character position of the target string within the source string. The strings can contain multi-byte characters.
IS–LEAD–BYTE Function
Returns TRUE if the first byte of a string is valid as a lead byte of a multi-byte character. It returns FALSE if the first byte of a string is not valid as a lead byte.
LASTKEY Function
Returns the integer code of the most recent key sequence returned from the keyboard buffer. A key sequence is the set of keystrokes necessary to send one character or function key to the application. The LASTKEY values are available only after the Input Method Editor places the data in the keyboard buffer.
LC Function
Changes any uppercase letters in a character string to lowercase. Any double-byte characters in the string are not changed.
LEFT–TRIM Function
Removes specified leading characters in a character string. The string and trimmed characters can contain multi-byte characters.
LENGTH Function
Returns the number of characters or bytes in a string.
The type option selects the unit for length. You can choose CHARACTER, COLUMN, or RAW (for bytes).
LOOKUP Function
Returns an integer that indicates the position of an expression in a list. It returns a 0 if the expression is not in the list. The list, expression, and delimiter can contain multi-byte characters.
MATCHES Operator
Compares a character expression to a pattern and returns a TRUE value if the expression satisfies the pattern criteria. The expression and pattern can contain multi-byte characters.
NUM–ENTRIES Function
Returns the number of items in a character-delimited list of strings. All strings can contain multi-byte characters.
OVERLAY Statement
Overlays a character expression in a field or variable starting at a given position, and optionally for a given length. The type option selects the unit for length and position. You can choose CHARACTER, RAW (for bytes), or COLUMN.
R–INDEX Function
Returns an integer that indicates the position of the target string within the source string. The search is performed right to left. Both strings can contain multi-byte characters.
READKEY Statement
Reads one key sequence1 from an input source and sets the value of READKEY to the keycode of that key sequence. READKEY and LASTKEY values are available only after the Input Method Editor places the data in the keyboard buffer.
REPLACE Function
Lets you replace a substring with another substring. Both substrings can contain multi-byte characters.
RIGHT–TRIM Function
Removes specified trailing characters from a character string. The string and trimmed characters can contain multi-byte characters.
SEARCH Function
Searches the directories and libraries defined in the PROPATH environment variable for a file. The opsys-file can contain multi-byte characters.
STRING Function
Converts a value of any data type in source into a character value. The source can contain multi-byte characters.
SUBSTITUTE Function
Returns a character string that is made up of a base string plus substitutes arguments in the string. The base string and arguments can contain multi-byte characters.
SUBSTRING Function
Extracts a position of a character string from a field or variable. The type option selects the units for length and position. You can choose CHARACTER, RAW (for bytes), COLUMN, or FIXED.
The FIXED type specifies that the maximum length is measured in bytes and the position in characters. If the last byte or bytes represent part of, but not all of, a multi-byte character, these bytes are excluded.
SUBSTRING Statement
Replaces characters in a field or variable with an expression you specify. You can replace the lead bytes or trail byte of the source string. The type option selects the unit for length and position. You can choose CHARACTER, FIXED, COLUMN, or RAW (for bytes).
With the FIXED option, if the last byte or bytes represent part of, but not all of, a multi-byte character, these bytes are excluded.
TRIM Function
Removes leading and trailing single-byte spaces in a character string. The string and trimmed characters can contain multi-byte characters.
  1. A key sequence is the set of keystrokes necessary to send one character or function key to the application.


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