Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : CURRENT-LANGUAGE statement
 

CURRENT-LANGUAGE statement

Sets the CURRENT-LANGUAGE variable for the current ABL session.
Note: Does not apply to SpeedScript programming.

Syntax

CURRENT-LANGUAGE = string-expression
string-expression
A character-string expression that specifies a language name or a comma-separated list of language names.

Example

This example procedure uses the CURRENT-LANGUAGE function to find the current language, prompts the user to choose a new language, and then uses the CURRENT-LANGUAGE statement to reset and display the name of the new current language:
r-chglng.p
DEFINE VARIABLE cur-lang AS CHARACTER FORMAT "x(10)" VIEW-AS RADIO-SET
RADIO-BUTTONS czech, "Czech",
danish, "Danish",
dutch, "Dutch",
english, "English",
french, "French",
german, "German",
hungar, "Hungarian",
italian, "Italian",
norweg, "Norwegian",
polish, "Polish",
portug, "Portuguese",
swedish, "Swedish".

cur-lang = IF CURRENT-LANGUAGE = "?" THEN "English" ELSE CURRENT-LANGUAGE.

UPDATE cur-lang NO-LABELS.

CURRENT-LANGUAGE = cur-lang.
MESSAGE "New language is" CURRENT-LANGUAGE.

Notes

*The value of CURRENT-LANGUAGE might be a comma-separated list of language names. If so, the AVM searches r-code for a text segment that matches the first language in the list. If that segment is not found, then it searches for a text segment for the next entry in the list until a segment is found.
*You can initialize the CURRENT-LANGUAGE variable with the Language (-lng) parameter.
*The behavior of CURRENT-LANGUAGE when one procedure calls another is as follows:
*If a procedure changes the value of CURRENT-LANGUAGE, calls from the procedure to the CURRENT-LANGUAGE function return the name of the new language, but the procedure continues to use the character strings of the original language.
*If the procedure then runs another procedure, when the called procedure gets control, calls from the called procedure to the CURRENT-LANGUAGE function return the name of the new language, and the called procedure uses the character strings of the new language.
*When the called procedure finishes and control returns to the original procedure, calls from the original procedure to the CURRENT-LANGUAGE function return the name of the new language, but the original procedure continues to use the character strings of the original language.

See also

COMPILE statement, CURRENT-LANGUAGE statement