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

     Returns a string representing a substring of the specified buffer,
     range, or string.

  Syntax

     string2 := SUBSTR ({buffer | range | string}, integer1 [, integer2])

  Parameters

     buffer     A buffer containing the substring.

     range      A range containing the substring.

     string1    A string containing the substring.

     integer1   The character position at which the substring starts.  The
                first character position is 1.

     integer2   The number of characters to include in the substring.  If
                you do not specify this parameter, DECTPU sets the
                substring's end point at the end of the specified buffer,
                range, or string.

  Example

     file_type := SUBSTR ("login.com", 6, 4);

     Returns in the variable FILE_TYPE the string ".com":  the substring
     starts at the sixth character position (the period) and contains 4
     characters (.com).  If you use a larger number for integer2 (for
     example, if you use 10), the contents of the variable are the same and
     no error is signaled.  If you omit the last parameter (in this case,
     the 4), DECTPU sets the substring's end point at the end of the string
     "login.com".

  Related topics

     ASCII    FAO    INT    STR
Close Help