Jump to content

ULSGetLocales: Difference between revisions

From EDM2
Ak120 (talk | contribs)
No edit summary
Ak120 (talk | contribs)
No edit summary
Line 8: Line 8:


Parameters:
Parameters:
flag     Indicates which type of locales to list: system, user, or both.
;flag
          Only the first character is significant, and (if specified) must
:Indicates which type of locales to list: system, user, or both.
          be one of the following values:
:Only the first character is significant, and (if specified) must be one of the following values:
            B = List both user and system locales; this is the default.
::B = List both user and system locales; this is the default.
            S = List system locales only.
::S = List system locales only.
            U = List user locales only.
::U = List user locales only.


stem     The name of a stem variable which will be populated with the
;stem
          list of locales. <stem>.0 will contain an integer <n>,
:The name of a stem variable which will be populated with the list of locales.  
          indicating the number of locales found; and <stem>.1 through
:<stem>.0 will contain an integer <n>, indicating the number of locales found; and <stem>.1 through <stem>.<n> will each contain a single locale name.
          <stem>.<n> will each contain a single locale name.


==Return Value==
==Return Value==

Revision as of 12:50, 30 July 2016

Description

Gets the list of locales known to the system.

Locales may be either system locales (standardized locales defined by OS/2) or user locales (instantiated locale instances which appear in the Country Palette or "Locale" object).

Arguments

ULSGetLocales( [flag], stem )

Parameters:

flag
Indicates which type of locales to list: system, user, or both.
Only the first character is significant, and (if specified) must be one of the following values:
B = List both user and system locales; this is the default.
S = List system locales only.
U = List user locales only.
stem
The name of a stem variable which will be populated with the list of locales.
<stem>.0 will contain an integer <n>, indicating the number of locales found; and <stem>.1 through <stem>.<n> will each contain a single locale name.

Return Value

The number of locales returned (the same as <stem>.0). If an error occurs, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.

Example

Code

/* Get a list of all user locales defined on the system */
CALL ULSGetLocales 'U', 'locales.'
SAY 'There are' locales.0 'user locales defined:'
DO i = 1 TO locales.0
   SAY ' ->' locales.i
END

Output

There are 2 user locales defined:
-> en_CA
-> ja_JP