
  PROCEDURE [INLINE] clp$right_justify_string
    (VAR substring: string ( * <= 255));

?? PUSH (LISTEXT := ON) ??

    VAR
      count_index: integer,
      swap_index: integer,
      string_length: integer;

    string_length := STRLENGTH (substring);

    FOR count_index := string_length DOWNTO 1 DO {Start at right end of string}
      IF substring (count_index) <> ' ' THEN {Look for first non-blank
        {character}
        IF count_index <> string_length THEN {If there are no blanks no need to
          {right justify}
          FOR swap_index := count_index DOWNTO 1 DO
            substring (string_length) := substring (swap_index); {Move
            {character to rightmost spot}
            substring (swap_index) := ' '; {Blank out old position}
            string_length := string_length - 1;
          FOREND;
        IFEND;
        RETURN;
      IFEND;
    FOREND;

  PROCEND clp$right_justify_string;

*copy clh$right_justify_string

?? POP ??

