User Tools

Site Tools


locale_load_environment_file_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== LOCALE (load environment file) ====== Previous pageReturn to chapter overviewNext page
LOCALE( file| )
setting, value

blk2blue.jpg

LOCALE Allows the user to load a specific environment file (.ENV) at run-time and also to set individual environment settings.
file A string constant or variable containing the name (including extension) of the environment file (.ENV) to load, or the keyword WINDOWS. This may be a fully-qualified DOS pathname.
setting A string constant or variable containing the name of the environment variable to set. Valid choices are listed under the Environment Files section.
value A string constant or variable containing the environment variable setting.

You can set the CodePage and Locale by calling the LOCALE function with the first parameter equal to 'CLACODEPAGE' and 'CLALCID' respectively, for example:

LOCALE('CLACODEPAGE', 1253)

LOCALE('CLALCID', 1032)

You can set the CodePage and Locale by specifying CLACODEPAGE and CLALCID parameters in the program ENV file.

The LOCALE function also allows the user to load a specific environment file (.ENV) at run-time and also to set individual environment settings. This allows an application to load another file to override the default appname.ENV file, or to specify individual environment file settings when no environment file exists.

The WINDOWS keyword as the file parameter specifies use of Windows' default values for CLACOLSEQ, CLACASE and CLAAMPM. When specifying individual settings, the value parameter does not require double quotes around each individual item in the value string, unlike the syntax required in an .ENV file.

Errors Posted:

02 File Not Found
05 Access Denied

Example:

LOCALE('CLACODEPAGE', 1253) ! Greek codepage
LOCALE('CLALCID', 1032) ! Greek local id (LCID)

LOCALE('MY.ENV')                       !Load an environment file

LOCALE('WINDOWS')                      !Set default CLACOLSEQ, CLACASE and CLAAMPM

LOCALE('CLABUTTON','OK,&Si,&No,&Abortar,&Ignora,&Volveratratar,Cancelar,&Ayuda')

                                      !Set CLABUTTON to Spanish

LOCALE('CLACOLSEQ',|

'AÄÅÆaàáâäåæBbCÇcçDdEÉeèéêëFfGgHhIiìíîïJjKkLlMmNÑnñOÖoòóôöPpQqRrSsßTtUÜuùúûüVvWwXxYyZzÿ')

                                      !Set the collating sequence

LOCALE('CLACASE','ÄÅÆÇÉÑÖÜ,äåæçéñòü')  !Set upper/lower case pairs

LOCALE('CLAMSG2','No File Found')      !Set ERROR() message for ERRORCODE()=2

See Also:

Internationalization

Prop:CodePage

Prop:Locale

Environment Files

OEM

locale_load_environment_file_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)