Jump to content

ULSGetLocales: Difference between revisions

From EDM2
Ak120 (talk | contribs)
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Description==
Gets the list of locales known to the system.
Gets the list of locales known to the system.


Line 5: Line 4:


==Arguments==
==Arguments==
ULSGetLocales( [flag], stem )
ULSGetLocales( [flag], stem )


Parameters:
===Parameters===
;flag
;flag:Indicates which type of locales to list: system, user, or both.
: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:
: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 list of locales.  
;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.
:<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==
==Return Value==
The number of locales returned (the same as <stem>.0). If an error
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.
occurs, an empty string ("") is returned and the global ULSERR variable
will be set to a non-zero value.


==Example==
==Example==
Line 38: Line 32:
  -> ja_JP
  -> ja_JP


[[Category:The OS/2 API Project]]
[[Category:RxULS]]

Latest revision as of 14:31, 14 August 2017

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