?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Interpreter : Change Natural Language' ??
MODULE clm$change_natural_language;

{
{  PURPOSE:
{    This module contains the ring 11 processor for the CHANGE_NATURAL_LANGUAGE command.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
*copyc clp$evaluate_parameters
*copyc osp$set_natural_language
?? TITLE := 'clp$_change_natural_language', EJECT ??

  PROCEDURE [XDCL] clp$_change_natural_language
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$chanl) change_natural_language, chanl (
{   natural_language, nl: any of
{       key
{         danish, dutch, english, finnish, flemish, french, german, italian, norwegian, portuguese, spanish
{         swedish, us_english
{       keyend
{       name
{     anyend = $required
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 13] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 1, 25, 14, 8, 9, 639],
    clc$command, 3, 2, 1, 0, 0, 0, 2, 'OSM$CHANL'], [
    ['NATURAL_LANGUAGE               ',clc$nominal_entry, 1],
    ['NL                             ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 513,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$name_type],
    FALSE, 2],
    488, [[1, 0, clc$keyword_type], [13], [
      ['DANISH                         ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['DUTCH                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['ENGLISH                        ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['FINNISH                        ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['FLEMISH                        ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['FRENCH                         ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['GERMAN                         ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['ITALIAN                        ', clc$nominal_entry, clc$normal_usage_entry, 8],
      ['NORWEGIAN                      ', clc$nominal_entry, clc$normal_usage_entry, 9],
      ['PORTUGUESE                     ', clc$nominal_entry, clc$normal_usage_entry, 10],
      ['SPANISH                        ', clc$nominal_entry, clc$normal_usage_entry, 11],
      ['SWEDISH                        ', clc$nominal_entry, clc$normal_usage_entry, 12],
      ['US_ENGLISH                     ', clc$nominal_entry, clc$normal_usage_entry, 13]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$natural_language = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF pvt [p$natural_language].value^.kind = clc$keyword THEN
      osp$set_natural_language (pvt [p$natural_language].value^.keyword_value, status);
    ELSE
      osp$set_natural_language (pvt [p$natural_language].value^.name_value, status);
    IFEND;

  PROCEND clp$_change_natural_language;

MODEND clm$change_natural_language;
