Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VAXTPU SUBSTR — VMS 5.2

 SUBSTR

    Returns a string representing a substring of a specified string or
    range.

 Syntax

    string2 := SUBSTR ({string1 | range}, integer1, integer2)

 Parameters

    string1    A string containing the substring.

    range      A range 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.

 Example

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

    Returns in the variable FILE_TYPE the string ".com":  the substring
    starts at the seventh 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.

 Related topics

    ASCII    FAO    INT    STR

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026