Library /sys$common/syshlp/TPUHELP.HLB  —  EDIT
  EDIT

     Modifies a string according to the keywords you specify.  This is
     similar to the DCL lexical function F$EDIT; the differences are
     explained in the DEC Text Processing Utility Manual.

     Optionally, returns a string, range, or buffer containing the edited
     text.

  Syntax

     [returned_buffer |
      returned_range  |
      returned_string  := ] EDIT ({buffer | range | string},
                                   keyword1[,...] [,keyword2] [,keyword3])

  Parameters

      buffer            The buffer in which you want DECTPU to edit text.
                        Note that you cannot use the keyword NOT_IN_PLACE if
                        you specify a buffer for the first parameter.

      range             The range in which you want DECTPU to edit text.
                        Note that you cannot use the keyword NOT_IN_PLACE if
                        you specify a range for the first parameter.

      string            The string you want to modify.  If you specify a
                        return value, the returned string consists of the
                        string you specify for the first parameter, modified
                        in the way you specify in the second and subsequent
                        parameters.  If you specify IN_PLACE for the third
                        parameter, EDIT makes the specified change to the
                        string specified in the first parameter.  EDIT has
                        no effect on string constants.

      keyword1          A keyword specifying the editing operation you want
                        to perform on the string.  Valid keywords are:
                        COLLAPSE, COMPRESS, INVERT, LOWER, TRIM,
                        TRIM_LEADING, TRIM_TRAILING, or UPPER.

      keyword2          A keyword specifying whether DECTPU quote characters
                        are used as quote characters or as regular text.
                        The valid keywords are ON or OFF.  The default is
                        ON.

      keyword3          A keyword indicating where DECTPU is to make the
                        indicated change.  The valid keywords and their
                        meaning are as follows:

                        Keyword         Meaning
                        -------         -------
                        IN_PLACE        Make the indicated change in place.
                                        This is the default.

                        NOT_IN_PLACE    Leave the the specified string
                                        unchanged and return a string that
                                        is the result of the specified
                                        editing.  You cannot use NOT_IN_PLACE
                                        if the first parameter is specified as
                                        a range or buffer.  To use
                                        NOT_IN_PLACE, you must specify
                                        a return value for EDIT.

      returned_buffer   A variable of type buffer pointing to the buffer
                        containing the modified text, if you specify a
                        buffer for the first parameter.  The variable
                        "returned_buffer" points to the same buffer pointed
                        to by the buffer variable specified as the first
                        parameter.

      returned_range    A range containing the modified text, if you specify
                        a range for first parameter.  The returned range
                        spans the same text as the range specified as a
                        parameter, but they are two separate ranges.  If you
                        subsequently change or delete one of the ranges,
                        this has no effect on the other range.

      returned_string   A string containing the modified text, if you
                        specify a string for the first parameter.

  Examples

     1.  returned_value := EDIT (the_string, COLLAPSE, OFF, NOT_IN_PLACE);

         Removes all spaces and tabs from the string pointed to by
         "the_string" and does not treat quotation marks or apostrophes as
         quote characters.  Returns the modified string in the variable
         "returned_value", but does not change the string in the variable
         "the_string".

     2.  The following procedure shows a general way of changing any input
         string to lower case; the string with the changed case is written
         to the message area:

         PROCEDURE user_lowercase_string (input_string)
            EDIT (input_string, LOWER);
            MESSAGE (input_string);
         ENDPROCEDURE;

  Related Topics

     CHANGE_CASE    TRANSLATE
Close Help