ULSGetLocales: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
Gets the list of locales known to the system. | 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== | ==Arguments== | ||
Line 10: | Line 8: | ||
Parameters: | 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== | ==Return Value== | ||
Line 28: | Line 26: | ||
==Example== | ==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 | |||
[[Category:The OS/2 API Project]] | [[Category:The OS/2 API Project]] |
Revision as of 18:05, 26 June 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