Jump to content

ULSGetLocales: Difference between revisions

From EDM2
Created page with "==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 (instantiate..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users 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.


    Locales may be either system locales (standardized locales defined by OS/2)
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).
    or user locales (instantiated locale instances which appear in the Country
    Palette or "Locale" object).


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


Parameters:
===Parameters===
      flag     Indicates which type of locales to list: system, user, or both.
;flag:Indicates which type of locales to list: system, user, or both.
                Only the first character is significant, and (if specified) must
:Only the first character is significant, and (if specified) must be one of the following values:
                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>.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     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==
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==
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


      Code
Output
 
There are 2 user locales defined:
        /* Get a list of all user locales defined on the system */
-> en_CA
        CALL ULSGetLocales 'U', 'locales.'
-> ja_JP
        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:
[[Category:RxULS]]
        -> en_CA
        -> ja_JP

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