?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE : Convert Operator Console String to Ascii' ??
MODULE clm$convert_console_to_ascii;

{
{ PURPOSE:
{   This module contains the procedure that processes the special character sequences used to represent
{   certain ASCII characters that are not available on the operator console.
{   Such a sequence consists of two characters the first of which is a slant (/).
{

?? PUSH (LISTEXT := ON) ??
*copyc oss$mainframe_paged_literal
*copyc ost$status
*copyc ost$string
?? POP ??
?? NEWTITLE := 'clp$convert_console_to_ascii', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$convert_console_to_ascii
    (    console_string: string ( * );
     VAR ascii_string: string ( * );
     VAR status: ost$status);

    VAR
      conversion_table: [STATIC, READ, oss$mainframe_paged_literal] array [char] of char := [REP 40 of ' ',
            '[', ']', '''', '>', ':', '<', ' ', '/', '_', '^', '"', '#', '$', '\', ';', '?', '{', '}', ' ',
            ' ', ' ', '.', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
            'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', REP 165 of ' '];

    VAR
      i: ost$string_index,
      j: ost$string_index;

    status.normal := TRUE;
    ascii_string := '';
    i := 1;
    j := 1;

  /loop/
    WHILE i <= STRLENGTH (console_string) DO
      IF console_string (i) = '/' THEN
        i := i + 1;
        IF i > STRLENGTH (console_string) THEN
          EXIT /loop/;
        IFEND;
        ascii_string (j) := conversion_table [console_string (i)];
      ELSE
        ascii_string (j) := console_string (i);
      IFEND;
      i := i + 1;
      j := j + 1;
    WHILEND /loop/;

  PROCEND clp$convert_console_to_ascii;

MODEND clm$convert_console_to_ascii;
