$LANGUAGES


General Form:

numeric_receiver = $LANGUAGES <<"hello world", "bonjour monde", "guten tag">> [USING pool]
numeric_receiver = $LANGUAGES FLD(rec$.fld$)
$LANGUAGES FLD(rec$.fld$) = *numeric_expression

As an expression, $LANGUAGES constructs a KCML_Languages object containing a copy of every string in a chevron literal or a multi-language field.

As a receiver, $LANGUAGES is used to copy strings from a KCML_Languages object into a multi-language field.

Example

 00010 $COMPLIANCE 3
     : 
     : DEFRECORD record
     :     FLD text$<<3>>30
     :     END RECORD
     : 
     : DEFSUB 'main()
     :     LOCAL DIM r1$_record
     :     LOCAL DIM r2$_record
     :     LOCAL DIM p AS KCML_Languages
     :     
     :     // Creating a KCML_Languages object from a chevron literal:
     :     p = $LANGUAGES<<"hello", "bonjour", "guten tag">>
     :     
     :     // Using the splat operator to copy its contents into a multi-language field:
     :     $LANGUAGES FLD(r1$.text$) = *p
     :     
     :     // Copying one multi-language field into another:
     :     p = $LANGUAGES FLD(r1$.text$)
     :     $LANGUAGES FLD(r2$.text$) = *p
     :     
     :     // This could also have been written as:
     :     $LANGUAGES FLD(r2$.text$) = *$LANGUAGES FLD(r1$.text$)
     :     
     :     // $LANGUAGES expressions can be passed to and from functions:
     :     'set(BYREF r1$, $LANGUAGES<<"hello", "bonjour", "guten tag">>)
     :     $LANGUAGES FLD(r2$.text$) = *'mklang(GET POOL)
     : END SUB
     : 
     : DEFSUB 'set(BYREF r$_record, p AS KCML_Languages)
     :     $LANGUAGES FLD(r$.text$) = *p
     : END SUB
     : 
     : DEFSUB 'mklang(pool AS PoolHandle) AS KCML_Languages
     :     // Returning a $LANGUAGES expression from a function. By default, a
     :     // $LANGUAGES expression is tied to the lifetime of the current
     :     // function pool. Use a USING clause to allocate the expression elsewhere.
     :     RETURN $LANGUAGES<<"hello", "bonjour", "guten tag">> USING pool
     : END SUB

Compatibility

Introduced with KCML 7.17.

See also:

International support