Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

BUILT-INS

DATA_TYPES

DEBUGGER

KEYWORDS

KEYNAME_TABLE

SYNTAX

ADD_KEY_MAP

ADJUST_WINDOW

ANCHOR

ANY

APPEND_LINE

ARB

ASCII

ATTACH

BEGINNING_OF

CALL_USER

CHANGE_CASE

COMPILE

COPY_TEXT

CREATE_BUFFER

CREATE_KEY_MAP

CREATE_KEY_MAP_LIST

CREATE_PROCESS

CREATE_RANGE

CREATE_WINDOW

CURRENT_BUFFER

CURRENT_CHARACTER

CURRENT_COLUMN

CURRENT_DIRECTION

CURRENT_LINE

CURRENT_OFFSET

CURRENT_ROW

CURRENT_WINDOW

CURSOR_HORIZONTAL

CURSOR_VERTICAL

DEFINE_KEY

DELETE

EDIT

END_OF

ERASE

ERASE_CHARACTER

ERASE_LINE

EXECUTE

EXIT

EXPAND_NAME

FAO

FILE_PARSE

FILE_SEARCH

FILL

GET_INFO

HELP_TEXT

INDEX

INT

JOURNAL_CLOSE

JOURNAL_OPEN

KEY_NAME

LAST_KEY

LEARN_BEGIN

LEARN_END

LENGTH

LINE_BEGIN

LINE_END

LOOKUP_KEY

MAP

MARK

MATCH

MESSAGE

MOVE_HORIZONTAL

MOVE_TEXT

MOVE_VERTICAL

NOTANY

POSITION

QUIT

READ_CHAR

READ_FILE

READ_KEY

READ_LINE

REFRESH

REMAIN

REMOVE_KEY_MAP

SAVE

SCAN

SCANL

SCROLL

SEARCH

SELECT

SELECT_RANGE

SEND

SEND_EOF

SET

SHIFT

SHOW

SPAN

SPANL

SPAWN

SPLIT_LINE

STR

SUBSTR

TRANSLATE

UNDEFINE_KEY

UNMAP

UPDATE

WRITE_FILE

Example

Example

Side Effects

Example

Example

Example

Example

Example

Example

Example

Example

Example

Examples

Example

Example

Example

Example

Example

Example

Examples

Examples

Examples

Example

Example

Example

Example

Example

Example

Example

Examples

Resources returned

Example

Example

Example

Example

Example

Example

Example

Example

Example

Example

Example

Examples

BUFFERS

COMMAND_LINE

DEBUG

DEFINED_KEY

KEY_MAP

KEY_MAP_LIST

PROCESS

SCREEN

SYSTEM

WINDOWS

Any variable

A buffer variable

A marker variable

A process variable

A range variable

A string variable

A window variable

Examples

Example

Example

Example

Example

Examples

Example

Example

Example

Example

Example

Example

Example

Examples

Examples

Example

Example

Example

Example

Examples

Examples

Examples

Examples

Examples

Examples

Example

Example

Example

Example

Examples

Example

Examples

Examples

Examples

Example

Example

Example

AUTO_REPEAT

BELL

DEBUG

EOB_TEXT

FACILITY_NAME

FORWARD

INFORMATIONAL

INSERT

JOURNALING

KEY_MAP_LIST

MARGINS

MAX_LINES

MESSAGE_FLAGS

NO_WRITE

OUTPUT_FILE

OVERSTRIKE

PAD

PERMANENT

PROMPT_AREA

REVERSE

SCREEN_UPDATE

SCROLLING

SELF_INSERT

SHIFT_KEY

STATUS_LINE

SUCCESS

SYSTEM

TAB_STOPS

TEXT

TIMER

UNDEFINED_KEY

VIDEO

WIDTH

Examples

Example

Example

Examples

Example

Examples

Example

Example

Example

Example

Example

Examples

EXAMPLES

VAXTPU VAXTPU — VMS 4.6

 VAXTPU is a Text Processing Utility for VAX/VMS Version 4.0 and later.
 The utility consists of a procedural language, a compiler, an
 interpreter, and two editing interfaces written in VAXTPU.  The
 Extensible VAX Editor (EVE) and the VAXTPU EDT Keypad Emulator are
 examples of interfaces written in the VAXTPU programming language and
 layered on the utility.  You have access to the VAXTPU interpreter and
 compiler from both EVE and the EDT Keypad Emulator.  While using one of
 the editing interfaces, you can write procedures in VAXTPU to customize
 or extend your interface.

 This HELP file contains information about the VAXTPU language, such as
 descriptions of the built-in procedures, a list of language statements,
 and so on.  For more information on VAXTPU, see the VAX Text Processing
 Utility Reference Manual.  For sample VAXTPU programs, examine the
 source code files that create the two interfaces:
 SYS$LIBRARY:EVESECINI.TPU and SYS$LIBRARY:EDTSECINI.TPU.

Additional information available:

BUILT-INSDATA_TYPESDEBUGGERKEYWORDSKEYNAME_TABLE
SYNTAX

BUILT-INS

 The VAXTPU language provides 97 built-in procedures that you can use
 alone or in combination with language statements and other built-ins.
 Following is a list of the built-ins grouped according to the function
 they perform.  If you want more information on an individual built-in,
 enter the name of the built-in on the prompt line (you can abbreviate
 the name to its unique form).  The following conventions are used in
 the descriptions of the built-ins:

 {|}         Choose one of the enclosed items; for example, {a | b} means
             to choose either "a" OR "b".
 [ ]         Indicates an optional item. The CASE statement is an exception
             to this; the square bracket is required for case-selectors.
 buffer :=   An entry on the LHS of an assignment statement indicates that
             the built-in procedure returns a value of that type.



 Screen Layout
 -------------
    ADJUST_WINDOW     CREATE_WINDOW     MAP            REFRESH
    SHIFT             UNMAP             UPDATE


 Cursor Movement
 ---------------
    CURSOR_HORIZONTAL     CURSOR_VERTICAL     SCROLL


 Editing Position Modification
 -----------------------------
    MARK     MOVE_HORIZONTAL     MOVE_VERTICAL     POSITION


 Text Manipulation
 -----------------
    APPEND_LINE       BEGINNING_OF     CHANGE_CASE     COPY_TEXT
    CREATE_BUFFER     CREATE_RANGE     EDIT            END_OF
    ERASE             ERASE_CHARACTER  ERASE_LINE      FILE_PARSE
    FILE_SEARCH       FILL             MOVE_TEXT       READ_FILE
    SEARCH            SELECT           SELECT_RANGE    SPLIT_LINE
    TRANSLATE         WRITE_FILE


 Pattern Matching
 ----------------
    ANCHOR    ANY     ARB     LINE_BEGIN    LINE_END     MATCH
    NOTANY    REMAIN  SCAN    SCANL         SPAN         SPANL


 Editing Context Information
 ---------------------------
    CURRENT_BUFFER        CURRENT_CHARACTER     CURRENT_COLUMN
    CURRENT_DIRECTION     CURRENT_LINE          CURRENT_OFFSET
    CURRENT_ROW           CURRENT_WINDOW        GET_INFO
    SET                   SHOW


 Defining Keys
 -------------
    ADD_KEY_MAP      CREATE_KEY_MAP      CREATE_KEY_MAP_LIST
    DEFINE_KEY       KEY_NAME            LAST_KEY
    LOOKUP_KEY       REMOVE_KEY_MAP      UNDEFINE_KEY


 Multiple Processing
 -------------------
    ATTACH     CREATE_PROCESS       SEND        SEND_EOF     SPAWN


 Program and Procedure Execution
 -------------------------------
    COMPILE     EXECUTE        EXIT             QUIT         SAVE


 Miscellaneous
 -------------
    ASCII            CALL_USER      EXPAND_NAME      DELETE          FAO
    HELP_TEXT        INDEX          INT              JOURNAL_CLOSE
    JOURNAL_OPEN     LEARN_BEGIN    LEARN_END        LENGTH
    MESSAGE          READ_CHAR      READ_KEY         READ_LINE       STR
    SUBSTR



Additional information available:

ADD_KEY_MAPADJUST_WINDOWANCHORANYAPPEND_LINE
ARBASCIIATTACHBEGINNING_OFCALL_USER
CHANGE_CASECOMPILECOPY_TEXTCREATE_BUFFER
CREATE_KEY_MAPCREATE_KEY_MAP_LISTCREATE_PROCESS
CREATE_RANGECREATE_WINDOWCURRENT_BUFFERCURRENT_CHARACTER
CURRENT_COLUMNCURRENT_DIRECTIONCURRENT_LINECURRENT_OFFSET
CURRENT_ROWCURRENT_WINDOWCURSOR_HORIZONTALCURSOR_VERTICAL
DEFINE_KEYDELETEEDITEND_OFERASEERASE_CHARACTER
ERASE_LINEEXECUTEEXITEXPAND_NAMEFAO
FILE_PARSEFILE_SEARCHFILLGET_INFOHELP_TEXT
INDEXINTJOURNAL_CLOSEJOURNAL_OPENKEY_NAME
LAST_KEYLEARN_BEGINLEARN_ENDLENGTHLINE_BEGIN
LINE_ENDLOOKUP_KEYMAPMARKMATCHMESSAGE
MOVE_HORIZONTALMOVE_TEXTMOVE_VERTICALNOTANY
POSITIONQUITREAD_CHARREAD_FILEREAD_KEY
READ_LINEREFRESHREMAINREMOVE_KEY_MAPSAVE
SCANSCANLSCROLLSEARCHSELECTSELECT_RANGE
SENDSEND_EOFSETSHIFTSHOWSPANSPANL
SPAWNSPLIT_LINESTRSUBSTRTRANSLATE
UNDEFINE_KEYUNMAPUPDATEWRITE_FILE

ADD_KEY_MAP

 Adds one or more key maps to a key-map list.

 Format
    ADD_KEY_MAP (string1, string2, string3 [,...])

 string1   A string that specifies the name of the key-map list.

 string2   Either the string "first" or the string "last".  This parameter
           specifies whether the key map is added to the beginning or the end
           of the key-map list, respectively.  In cases where a key is defined
           in multiple key maps, the definition in the first key map in a
           key-map list is used.

 string3   A string that specifies the name of the key map to be added to the
           key-map list. You can specify more than one key map. Key maps are
           added to the key-map list in the order specified.  The order of a
           key map in a key-map list determines precedence among any
           conflicting key definitions.

Additional information available:

Example

Example

 help_keys := CREATE_KEY_MAP ("help_keys");
 ADD_KEY_MAP ("TPU$KEY_MAP_LIST", "first", help_keys);

 These statements create a key map called help_keys and add it to
 the default key-map list, TPU$KEY_MAP_LIST.  Keys defined in the
 new key map are invoked over definitions in the key maps already
 in the list.

ADJUST_WINDOW

 Changes the size and/or screen location of a window.

 Format
    ADJUST_WINDOW (window, integer1, integer2)

 window   The screen region whose size or location you want to change.
          The window that you specify becomes the current window.
 integer1 The signed (+/-) integer value to be added to the screen line
          number at the top of the window.
 integer2 The signed (+/-) integer value to be added to the screen line
          number at the bottom of the window.

Additional information available:

ExampleSide Effects

Example

 ADJUST_WINDOW (main_window, -5, +5)

 This statement enlarges main_window by adding 5 lines to the top
 of the window and 5 lines to the bottom of the window.  If the
 screen line number at the top of the window is 11, this statement
 changes the screen line number to 6.  (If you use this statement
 when the top line of the window is number 1, you will get a
 warning message, and the top of the window will remain at screen
 line number 1.)

Side Effects

 This built-in causes the "original_top" and "original_bottom"
 lines defined when the window is created to be permanently
 modified, making the changed line numbers the new "original" value
 of the window.  Part or all of the window may be redisplayed or
 scrolled so that the current position at the time of the
 adjustment remains visible.

ANCHOR

 Disables seek search and incremental search modes of seaching for
 patterns and ties a search for a matching string to the current
 character position.  By default, when the SEARCH built-in fails to find
 a matching pattern, the character position is moved one position and
 the search continues until a match is found or until an end of search
 condition is reached.  ANCHOR disables this continuous mode of
 searching (which can be either a seek search, the default, or an
 incremental search) and applies the pattern only once.

 Format
   ANCHOR

Additional information available:

Example

Example

 pat1 := ANCHOR & 'a' & '123'

 This assignment statement creates a pattern that is made up of the
 character a and the digits 1, 2, and 3.  When pat1 is used as a
 parameter for SEARCH, the search will not move from character to
 character looking for this pattern.  The search will fail if the
 pattern is not found starting at the current character position.

ANY

 Returns a pattern that will match any single character in the string
 used as a parameter.

 Format
    pattern := ANY (string)

 string   A string that contains the characters you want to match.

Additional information available:

Example

Example

 pat1 := ANY ('hijkl')

 This assignment statement creates a pattern that will match any
 one of the characters 'hijkl'.

APPEND_LINE

 Moves the current line to the end of the previous line.

 Format
    APPEND_LINE

Additional information available:

Example

Example

 The following procedure causes the character preceding the cursor
 to be deleted.  If you are at the beginning of a line, the current
 line will be appended to the previous line.

 PROCEDURE user_delete_char
    IF     CURRENT_COLUMN = 1
     THEN
         APPEND_LINE;
     ELSE
         ERASE_CHARACTER (-1);
     ENDIF;
 ENDPROCEDURE;

ARB

 The pattern returned by ARB will match an arbitrary sequence of
 characters that is of the length you specify.  The sequence of
 characters starts at the current character position.

 Format
    pattern := ARB (integer)

 integer   The number of characters in the pattern.

Additional information available:

Example

Example

 pat1 := ARB (5)

 This assignment statement creates a pattern that matches the next
 5 characters starting at the current character position.  The
 characters themselves are arbitrary; it is the number of
 characters that is important for a pattern created with ARB.

ASCII

 Returns a string of length 1, that represents the character of the DEC
 Multinational Character Set that corresponds to the integer that you
 provide.

 Format
    string := ASCII (integer)

 integer  The decimal value of a character in the DEC MCS.

Additional information available:

Example

Example

 my_character := ASCII(12)

 This assignment statement places the value of the FORM FEED
 character in the variable my_character.

ATTACH

 Deassigns the terminal and switches control from the current process to
 a previously created process.

 Format
    ATTACH [({integer|string})]

 integer    The process identification of the process to which
            terminal control will be switched. Use decimal
            numbers.
 string     A process name.

Additional information available:

Example

Example

 ATTACH ('JONES_2')

 This command changes the terminal's control to the process
 JONES_2.

BEGINNING_OF

 Returns a marker that points to the first position of a buffer or a
 range.

 Format
    marker := BEGINNING_OF ({buffer|range})

 buffer   The buffer whose beginning you want to mark.
 range    The range whose beginning you want to mark.

Additional information available:

Example

Example

 beg_main := BEGINNING_OF (main_buffer)

 This assignment statement stores the marker at the beginning of
 the main_buffer in the variable beg_main.

CALL_USER

 Allows you to call a program written in another language from within
 VAXTPU.  The CALL_USER parameters are passed to the external routine
 exactly as you enter them.  VAXTPU does not process the parameters in
 any way.  See the VAX Text Processing Reference Manual for an example
 of how to use CALL_USER to call a BASIC program to do floating point
 arithmetic.

 Format
    string2 := CALL_USER (integer, string1)

 integer  An integer that is passed to the external program by reference.
 string1  A string that is passed to the external program by descriptor.

CHANGE_CASE

 Modifies the case of all the alphabetic characters in the specified
 unit of text according to the keyword that you supply.

 Format
    CHANGE_CASE ({buffer|range|string}, keyword)

 buffer   The buffer in which the case will be changed.
 range    The range in which the case will be changed.
 string   The string in which the case will be changed.
 keyword  Specifies the case. Valid keywords are
          LOWER, UPPER, or INVERT.

Additional information available:

Example

Example

 CHANGE_CASE (main_buffer, UPPER)

 This command makes all the characters in the main buffer
 uppercase.  If you enter this command on the VAXTPU command line
 and if the main_buffer is associated with a visible window, you
 will see the command take effect immediately.

COMPILE

 Converts the statements in a string, a range, or a buffer into an
 internal compiled format.  COMPILE optionally returns a program.  Use
 the SET (INFORMATIONAL, ON) statement before a compile in order to see
 the compiler error messages.

 Format
    [program := ] COMPILE ({string|range|buffer})

 string   A string that is a  VAXTPU procedure or statement.
 range    A range that contains VAXTPU procedures and/or statements.
 buffer   A buffer that contains VAXTPU procedures and/or statements.

Additional information available:

Example

Example

 user_program := COMPILE (main_buffer)

 This command compiles the contents of the main buffer.  If the
 buffer contains executable statements, VAXTPU returns a program
 that stores these executable commands.  If the buffer contains
 procedure definitions, VAXTPU compiles the procedures and lists
 them in the procedure definition table so that you can call them
 later.

COPY_TEXT

 Makes a copy of the text you specify and places it in the current
 buffer.  If the current buffer is in insert mode, the text you specify
 will be inserted before the current position in the current buffer.  If
 the current buffer is in overstrike mode, the text you specify will
 replace text starting at the current position and continuing for the
 length of the string, range, or buffer.

 Format
    COPY_TEXT ({string|range|buffer})

 string   The text that you want to copy.
 range    A range that contains the text you want to copy.
 buffer   A buffer that contains the text you want to copy.

Additional information available:

Examples

Examples

 COPY_TEXT ('Perseus is near Andromeda.')

 When the buffer is set to insert mode, this command causes the
 string 'Perseus is near Andromeda.' to be placed in front of the
 current position in the current buffer.


 COPY_TEXT (ASCII (10))

 When the buffer is set to overstrike mode, this command causes the
 ASCII character for line feed to replace the current character in
 the current buffer.

CREATE_BUFFER

 Defines a new work space for editing text.  You can create an empty
 buffer or you can associate an input file name with the buffer.
 CREATE_BUFFER optionally returns a buffer.  When you want to use a
 buffer as a parameter for a VAXTPU built-in procedure, use the buffer
 variable.

 Format
    [buffer :=] CREATE_BUFFER (string1 [,string2])

 string1  The name of the buffer you want to create.
 string2  The file specification of an input file for the buffer.

Additional information available:

Example

Example

 nb := create_buffer ('new_buffer', 'login.com')

 This command creates a buffer called new_buffer and stores a
 pointer to the buffer in the variable nb.  The file specification,
 'login.com', is the input file for new_buffer.

CREATE_KEY_MAP

 Creates and names a key map.  CREATE_KEY_MAP optionally returns a
 string that is the name of the key map created.

 Format
    [string2]:= CREATE_KEY_MAP (string1)

 string1   A quoted string, or a variable name representing a string constant,
           that specifies the name of the key map you create.

Additional information available:

Example

Example

 PROCEDURE init_sample_key_map sample_key_map := CREATE_KEY_MAP
 ("sample_key_map"); DEFINE_KEY ("EXIT", CTRL_Z_KEY, "Exit application",
 sample_key_map); DEFINE_KEY ("COPY_TEXT ('XYZZY')", CTRL_B_KEY, "Magic
 Word", sample_key_map); ENDPROCEDURE;

 This procedure creates a key map and defines two keys in the key
 map.  The name of the key map is stored in the variable
 sample_key_map.

CREATE_KEY_MAP_LIST

 Creates and names a key-map list, and also specifies the initial key
 maps in the key-map list it creates.  CREATE_KEY_MAP_LIST optionally
 returns a string that is the name of the key-map list created.

 Format
    [string3]:= CREATE_KEY_MAP_LIST (string1, string2 [,...])

 string1   A quoted string, or a variable name representing a string constant,
           that specifies the name of the key-map list that you create.

 string2   Strings that specify the names of the initial key maps within the
           key-map list you create.

Additional information available:

Example

Example

 PROCEDURE init_help_key_map_list help_user_keys := CREATE_KEY_MAP
 ("help_user_keys"); help_keys := CREATE_KEY_MAP ("help_keys");
 help_key_list := CREATE_KEY_MAP_LIST ("help_key_list", help_user_keys,
 help_keys); ENDPROCEDURE;

 This procedure creates two key maps, and groups them into a
 key-map list.

CREATE_PROCESS

 Starts a subprocess and associates a buffer with it.  You can
 optionally specify an initial command to send to the subprocess.
 CREATE_PROCESS returns a process.

 Format
    process := CREATE_PROCESS (buffer [,string])

 buffer   The buffer in which to store output from the subprocess.
 string   The first command to send to the subprocess.

Additional information available:

Example

Example

 my_mail_process := CREATE_PROCESS (second_buffer, '$ mail')

 This assignment statement creates a subprocess and specifies
 second_buffer as the buffer in which the output from the
 subprocess will be stored.  It also sends the DCL MAIL command as
 the first command to be executed.

CREATE_RANGE

 Returns a range that includes two markers and all the characters
 between them.  You must specify how the characters in the range are to
 be displayed when they are visible on the screen (no special video,
 reverse video, bolded, blinking, or underlined).

 Format
    range := CREATE_RANGE (marker1, marker2, keyword)

 marker1  The character position at which the range begins.
 marker2  The character position at which the range ends.
 keyword  Video attribute of the range. Valid keywords are
          NONE, UNDERLINE, BOLD, BLINK, or REVERSE.

Additional information available:

Example

Example

 my_range := CREATE_RANGE (first_marker, second_marker, BOLD)

 The assignment statement creates a range starting at first_marker
 and ending at second_marker.  When this range is visible on the
 screen, the characters in the range will be underlined.

CREATE_WINDOW

 Defines a screen area called a window.  You must specify the screen
 line number at which the window starts and the length of the window.
 CREATE_WINDOW optionally returns a window.

 Format
    [window :=] CREATE_WINDOW (integer1, integer2, keyword)

 integer1 The screen line number at which the window starts.
 integer2 The number of rows in the window.
 keyword  The state of the status line. Valid keywords are
          ON or OFF.

Additional information available:

Example

Example

 new_window := CREATE_WINDOW (11, 10, ON)

 This assignment statement creates a window that starts at screen
 line number 11 and is 10 rows long and assigns it to the variable
 new_window.  A status line will be displayed as the last row of
 the window.  To make this window visible, you must associate an
 existing buffer with it and map the window to the screen with the
 following command:

 MAP (new_window, buffer_variable)

CURRENT_BUFFER

 Returns the buffer in which you are currently positioned.

 Format
    buffer := CURRENT_BUFFER

Additional information available:

Examples

Examples

 my_cur_buf := CURRENT_BUFFER

 This assignment statement stores a pointer to the current buffer
 in the variable my_cur_buf.


 SHOW (CURRENT_BUFFER)

 This command returns the buffer in which you are currently
 positioned and uses that buffer as the parameter for the SHOW
 built-in.

CURRENT_CHARACTER

 Returns a string one character long for the current character in the
 current buffer.

 Format
    string := CURRENT_CHARACTER

Additional information available:

Examples

Examples

 my_cur_char := CURRENT_CHARACTER

 This assignment statement stores the string that represents the
 current character in the variable my_cur_char.


 MESSAGE (CURRENT_CHARACTER)

 This statement returns the string that represents the current
 character and uses this string as the parameter for the MESSAGE
 built-in.

CURRENT_COLUMN

 Returns an integer that identifies the current column of the cursor on
 the screen.  Note that this will not reflect any movement of the
 current position that has occurred within a procedure in which this is
 used unless the built-in UPDATE (window) has preceded it.

 Format
    integer := CURRENT_COLUMN

Additional information available:

Examples

Examples

 my_cur_col := CURRENT_COLUMN

 This assignment statement stores the column position of the cursor
 in the variable my_cur_col.


 MESSAGE (STR (CURRENT_COLUMN))

 This statement combines three VAXTPU built-ins.  CURRENT_COLUMN
 returns the integer that is the current column position, STR
 converts the integer to a string, and MESSAGE writes this string
 to the message buffer.

CURRENT_DIRECTION

 Returns a keyword (FORWARD or REVERSE) that indicates the current
 direction of the current buffer.

 Format
    keyword := CURRENT_DIRECTION

Additional information available:

Example

Example

 my_cur_dir := CURRENT_DIRECTION

 This assignment statement stores in the variable my_cur_dir the
 keyword that indicates whether the current direction setting for
 the buffer is FORWARD or REVERSE.

CURRENT_LINE

 Returns a string that represents the current line.  The current line is
 the line on which the current character position is located.

 Format
    string := CURRENT_LINE

Additional information available:

Example

Example

 my_cur_lin := CURRENT_LINE

 This assignment statement stores in the variable my_cur_lin the
 string that represents the current line.  The current line is the
 line in the current buffer that contains the current character
 position.

CURRENT_OFFSET

 Returns an integer for the offset of the current character position
 within the current line.  The leftmost character position is offset 0.

 Format
    integer := CURRENT_OFFSET

Additional information available:

Example

Example

 my_cur_off := CURRENT_OFFSET

 This assignment statement stores the integer that is the offset
 position of the current character in the variable my_cur_off.

CURRENT_ROW

 Returns an integer that is the screen line on which the cursor is
 located.  Note that this will not reflect any movement of the current
 position which has occurred within a procedure in which this is used
 unless the built-in UPDATE (window) has preceded it.

 Format
    integer := CURRENT_ROW

Additional information available:

Example

Example

 my_cur_row := CURRENT_ROW

 This assignment statement stores in the variable my_cur_row the
 integer that is the screen line number on which the cursor is
 located.

CURRENT_WINDOW

 Returns the window in which the cursor is visible.

 Format
    window := CURRENT_WINDOW

Additional information available:

Example

Example

 my_cur_win := CURRENT_WINDOW

 This assignment statement stores the window that holds the cursor
 in the variable my_cur_win.

CURSOR_HORIZONTAL

 Moves the cursor position across the screen by the number of screen
 columns that you specify.

 Format
    CURSOR_HORIZONTAL (integer)

Additional information available:

Example

Example

 CURSOR_HORIZONTAL (1)

 This command moves the cursor position one screen column to the
 right.

CURSOR_VERTICAL

 Moves the cursor position up or down the screen by the number of screen
 lines that you specify.

 Format
    CURSOR_VERTICAL (integer)

Additional information available:

Example

Example

 CURSOR_VERTICAL (5)

 This command moves the cursor position five lines toward the
 bottom of the screen.

DEFINE_KEY

 Associates the executable VAXTPU code specified by the first parameter
 with the key specified by the second parameter.  The value for the
 second parameter must be a keyword for a valid key.  If the optional
 parameter string2 is used, it will be associated with the key
 definition as a comment that can be retrieved with the LOOK_UP key
 built-in.  The optional parameter string3 specifies the key map or
 key-map list in which the key is to be defined.  The default for this
 parameter is the first key map in the key-map list bound to the current
 buffer.

 Format
 DEFINE_KEY ({string1|buffer|range|program|learn},
             keyword [,string2 [,string3]])

Additional information available:

Examples

Examples

 DEFINE_KEY ('POSITION (main_window)', CTRL_A_KEY)

 This statement associates the VAXTPU statement POSITION
 (main_window) with the key combination CTRL/A.  Note that you must
 use quotes around the VAXTPU statement.


 DEFINE_KEY (main_buffer, KEY_NAME (PF4, SHIFT_KEY))

 This statement causes VAXTPU to compile the main_buffer
 (containing VAXTPU statements).  If there are no errors in the
 compilation, VAXTPU binds the executable code to the combination
 of the editor's shift key (PF1 by default) and PF4 on the keypad.


 DEFINE_KEY ('COPY_TEXT ("Extensible")', KEY_NAME ('z', SHIFT_KEY))

 This statement causes VAXTPU to make a copy of the word
 "Extensible" at the current character location in the current
 buffer, when you press the key combination PF1 (VAXTPU's default
 shift key) and z.  Notice that you must alternate the quote
 characters that are used as delimiters for the first parameter.
 Also notice that you must quote the keyboard character that you
 use in combination with the editor's shift key.

DELETE

 Removes VAXTPU structures from your editing context.  When you delete a
 structure, (for example, a range), all variables that refer to that
 structure are reset to null.  If the deleted structure had any
 associated resources, these resources are returned to the editor.

 Format
    DELETE ({buffer|marker|process|program|range|window})

Additional information available:

Resources returnedExample

Resources returned

 buffer  - memory for buffer control structure, pages for storing
           text, memory for associated ranges and markers

 marker  - memory for marker control structure

 process - memory for process control structure, subprocess

 program - memory for program control structure, memory for
           program code

 range   - memory for range control structure. (The text in a
           range is not owned by the range, but by the buffer.)

 window  - memory for window control structure and associated
           record history

Example

 DELETE (main_buffer)

 This statement deletes the main_buffer and any associated
 resources that VAXTPU allocated for the main_buffer.  As a result
 of this statement, SHOW (BUFFERS) will not list main_buffer as one
 of the buffers in your editing context.

EDIT

 Modifies a string according to the keywords you specify.  EDIT is
 similar to the DCL Lexical Function F$EDIT; however, there are some
 differences, which are noted in the VAX Text Processing Utility
 Reference Manual.

 Format
    EDIT (string, keyword1[,...] [,keyword2])

 string   The string that you want to modify.
 keyword1 The valid keywords are TRIM, TRIM_LEADING, TRIM_TRAILING,
          UPPER, LOWER, INVERT, COMPRESS, or COLLAPSE.
 keyword2 You can use this optional keyword to specify whether the
          VAXTPU quote characters are used as quote characters or
          as regular text. The valid keywords are ON or OFF.

Additional information available:

Example

Example

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

 PROCEDURE user_edit_string (input_string)
     is := input_string;
     EDIT (is, LOWER);
     MESSAGE (is);
 ENDPROCEDURE

END_OF

 Returns a marker that points to the last character position in a buffer
 or a range.

 Format
    marker := END_OF  ({Buffer|Range})

Additional information available:

Example

Example

 the_end := END_OF (main_buffer)

 This assignment statement stores the last position in the
 main_buffer in the variable the_end.

ERASE

 Removes the contents of the range or buffer that you specify.

 Format
    ERASE ({range|buffer})

Additional information available:

Example

Example

 ERASE (main_buffer)

 This command causes the contents of main_buffer to be removed.
 You still have a buffer named main_buffer in which you can
 manipulate text.

ERASE_CHARACTER

 Deletes the number of characters you specify and optionally returns a
 string that represents the characters you deleted.

 Format
    [string] :=  ERASE_CHARACTER (integer)

 integer  The number of characters you want to remove.

Additional information available:

Example

Example

 take_out_chars := ERASE_CHARACTER (10)

 This assignment statement removes the current character and the 9
 characters following it and stores them in the variable
 take_out_chars.

ERASE_LINE

 Removes the current line from the current buffer.  ERASE_LINE
 optionally returns a string.

 Format
    [string] := ERASE_LINE

Additional information available:

Example

Example

 take_out_line := ERASE_LINE

 This assignment statement removes the current line in the current
 buffer and stores the string of characters representing that line
 in the variable name take_out_line.

EXECUTE

 This built-in does one of the following:

  o  Executes programs that you have previously compiled.

  o  Compiles and then executes any executable statements in a buffer, a
     range, or a string.

  o  Replays or executes a learn sequence.

 Format
    EXECUTE ({program|string|buffer|learn|range})

Additional information available:

Example

Example

 EXECUTE (main_buffer)

 This command first compiles the contents of main_buffer and then
 executes any executable statements.  If you have any text in the
 main_buffer other than VAXTPU statements, you will get an error
 message.

EXIT

 Terminates the editing session and writes out any modified buffers that
 have associated files.  VAXTPU queries you for file names for any
 buffers that you have modified that do not already have an associated
 file.  Buffers that have the NO_WRITE attribute will not be written
 out.

 Format
    EXIT

EXPAND_NAME

 Returns a string that contains the name or names of any VAXTPU
 variables, keywords, or procedures (built-in or user-written) that
 begin with the string you specify.  VAXTPU searches its internal symbol
 tables to find a match, using your input string as the initial
 substring for the match.

 string2 :=  EXPAND_NAME (string1, keyword)

 string1  The initial substring of a VAXTPU name.
 keyword  The type of VAXTPU name you want to match. Valid keywords are:

          ALL - Matches all names.
          PROCEDURES - Matches only procedure names.
          KEYWORDS - Matches only keyword names.
          VARIABLES - Matches only variable names.

Additional information available:

Example

Example

 full_name := EXPAND_NAME ('CREATE', ALL)

 This assignment statement returns the following VAXTPU words in
 the string full_name:

 CREATE_BUFFER CREATE_PROCESS CREATE_RANGE CREATE_WINDOW

FAO

 Invokes the Formatted ASCII Output (FAO) system service to convert a
 control string to a formatted ASCII output string.  By specifying
 arguments for FAO directives in the control string, you can control the
 processing performed by the FAO system service.  The FAO built-in
 returns a string that contains the formatted ASCII output.

 Format
    string2 := FAO (string1 [, FAO Parameters])

 string1         A string that consists of the fixed text of the output
                 string and FAO directives.
 FAO parameters  In general, these parameters correspond to the FAO
                 directives in string1. See the VAX/VMS System Services
                 Reference Manual for information.

Additional information available:

Example

Example

 date_and_time := FAO ("!%D",0)

 This assignment statement stores the current date and time in the
 variable name date_and_time.


 The following procedure uses the FAO directive !SL in a control
 string to convert the number equated to the variable count to a
 string.  The converted string is stored in the variable "report"
 and then is written to the message area.

 PROCEDURE user_fao_conversion
     count := 57;
     report := FAO ("number of forms = !SL", count);
     MESSAGE (report);
 ENDPROCEDURE

FILE_PARSE

 Performs the equivalent of the DCL F$PARSE lexical function.  That is,
 it calls the RMS service $PARSE to parse a file specification and to
 return either an expanded file specification or the file specification
 field that you request.

 FILE_PARSE returns a string that contains the expanded file
 specification or the field you specify.  If you do not provide a
 complete file specification, FILE_PARSE supplies defaults in the return
 string.  If an error occurs during the parse, FILE_PARSE returns a null
 string.

 Format
   string := FILE_PARSE (string1, [string2, [string3, [keyword]]])

 string1  The file specification to be parsed.
 string2  A default file specification.
 string3  A related file specification.
 keyword  A field in a VMS file specification. Valid keywords are
          NODE, DEVICE, DIRECTORY, NAME, TYPE, or VERSION .

Additional information available:

Example

Example

 spec := FILE_PARSE ('program.pas', '[abbott]')

 This assignment statement calls RMS to parse and return a full
 file specification for the file program.pas.  The second parameter
 provides the name of the directory in which the file can be found.

FILE_SEARCH

 Calls the RMS service $SEARCH to search a directory file and return the
 full file specification for a file that you name.  If the file is not
 found, FILE_SEARCH returns a null string.

 Format
    string2 := FILE_SEARCH (string1)

 string1  The file name for which you want a full file specification.

Additional information available:

Example

Example

 fil := FILE_SEARCH ('SYS$SYSTEM:*.EXE')

 Each time this assignment statement is executed, it returns a
 string containing the resulting file specification of an EXE file
 in SYS$SYSTEM.  Since no version number is specified, only the
 latest version is returned.  When you get a null string, it means
 there are no more EXE files in the directory.

FILL

 Reformats the text within a buffer or a range, using integer1 and
 integer2 as left and right margins respectively.  When wrapping words,
 FILL uses the string you specify as a list of word separators.

 If you do not specify margins, the margin settings of the buffer are
 used.

 Format
    FILL ({buffer|range}, string [,integer1 [,integer2]])

 buffer      The buffer whose text you want to fill.
 range       The range whose text you want to fill.
 string      The characters you want to use as word separators.
 integer1    The value for the left margin.
 integer2    The value for the right margin.

Additional information available:

Examples

Examples

 FILL (CURRENT_BUFFER, ' ')

 When entering this statement, press the space bar between the
 quote characters to cause the space character to be used as a word
 separator.  This statement reformats the text in the current
 buffer so that the lines are approximately the same length, the
 space character is used as a word separator.


 FILL (my_buffer, ASCII(13) + ASCII(10), 5, 65)

 This statement fills the buffer my_buffer using the carriage
 return and line feed characters as word separators, and spacing
 the text between a left margin of 5 and a right margin of 65.

GET_INFO

 Provides information about the current status of your editing context.
 Use parameter1 to specify the general area about which you want
 information (COMMAND_LINE, SCREEN, any variable name, and so on) and
 use the VAXTPU string that identifies the specific information you want
 ("journal", "width", "type", and so on) as parameter2.

 Format
    return_value := GET_INFO ({parameter1, parameter2 |
                               parameter1, parameter2, parameter3})

 parameter1  Either a variable for a VAXTPU data type, or a keyword
             such as INTEGER or SYSTEM.  GET_INFO provides information
             about the general area specified as parameter1.  See
             Tables 4-1 and 4-2 in the VAX Text Processing Reference
             Manual for a list of valid parameters.

 parameter2  A VAXTPU string constant.  This string indicates the kind
             of information requested about the item in parameter1.
             See Tables 4-1 and 4-2 in the VAX Text Processing Reference
             Manual for a list of valid parameters.

 parameter3  A quoted string, a variable name, or an expression that evaluates
             to the name of either a key map or a key-map list. Parameter3 is
             valid only when parameter1 is the keyword DEFINED_KEY or the
             keyword KEY_MAP.


Additional information available:

BUFFERSCOMMAND_LINEDEBUGDEFINED_KEYKEY_MAP
KEY_MAP_LISTPROCESSSCREENSYSTEMWINDOWS

Any variableA buffer variableA marker variableA process variable
A range variableA string variableA window variableExamples

Any variable

  Parameter 2       | Return Value  (Parameter 1 is a variable)
 -------------------+----------------------------------------------+
  "type"            | Keyword     - Data type of item
 -------------------+----------------------------------------------+

A buffer variable

  Parameter 2       | Return Value  (Parameter 1 is a buffer variable)
 -------------------+------------------------------------------------+
  "first_range"     | Range    - First range in VAXTPU's internal list
                    | 0          if none
  "next_range"      | Range    - Next range in VAXTPU's internal list
                    | 0        - if no more
  "first_marker"    | Marker   - First marker in VAXTPU's internal list
                    | 0        - if none
  "next_marker"     | Marker   - Next marker in VAXTPU's internal list
                    | 0        - if no more
 -------------------+------------------------------------------------+

  Parameter 2       | Return Value  (Parameter 1 is a buffer variable)
 -------------------+------------------------------------------------+
  "character"       | String   - Character   at   the    current
                    |            character position
  "file_name"       | String   - Name  of  file  associated with
                    |            the buffer when created
  "map_count"       | Integer  - Number of windows associated with
                    |            the buffer
  "modified"        | (1 or 0) - Indicates whether the buffer has
                    |            been modified
  "name"            | String   - Name given buffer when created
  "offset"          | Integer  - Offset  of  current   character
                    |            position
  "offset_column"   | Integer  - Screen  column that the current
                    |            character position would occupy
                    |            if on the screen, unshifted
  "record_count"    | Integer  - Number of lines in the buffer
  "record_size"     | Integer  - Maximum length for lines in the
                    |            buffer
 -------------------+------------------------------------------------+
  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value  (Parameter 1 is a buffer variable)
 -------------------+------------------------------------------------+
  "direction"       | Keyword  - FORWARD or REVERSE
  "eob_text"        | String   - String representing the end-of-buffer
                    |            text
  "key_map list"    | String   - Returns the key-map list bound to the
                    |            buffer
  "left_margin"     | Integer  - Current left margin setting
  "right_margin"    | Integer  - Current right margin setting
  "max_lines"       | Integer  - Maximum number of records (lines) in
                    |            the buffer
  "mode"            | Keyword  - INSERT or OVERSTRIKE
  "no_write"        | (1 or 0) - Indicates  whether  the  buffer
                    |            (if  modified) should be output
                    |            to a file upon exit
  "output_file"     | String   - Name of explicitly SET output file
                    | 0          if none
 -------------------+------------------------------------------------+

  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value  (Parameter 1 is a buffer variable)
 -------------------+------------------------------------------------+
  "permanent"       | (1 or 0) - Indicates whether the buffer is
                    |            permanent  or  if  it  can   be
                    |            deleted
  "system"          | (1 or 0) - Indicates whether the buffer is
                    |            a system buffer
  "tab_stops"       | String   - Returns a string of the tab stop
                    |   or       values separated by spaces; or an
                    | Integer    integer that is the interval between
                    |            tab stops
 -------------------+------------------------------------------------+
 A return integer value of (1 or 0) indicates True or False
 respectively.

A marker variable

  Parameter 2       | Return Value  (Parameter 1 is a marker variable)
 -------------------+------------------------------------------------+
  "buffer"          | Buffer   - Buffer in which the  marker  is
                    |            located
  "offset"          | Integer  - Offset of the marker  from  the
                    |            beginning of the line
  "offset_column"   | Integer  - Screen  column  that the marker
                    |            would  occupy if it were on the
                    |            screen, unshifted
  "video"           | Keyword  - Video attribute of the marker

A process variable


  Parameter 2       | Return Value (Parameter 1 is a process variable)
 -------------------+------------------------------------------------+
 "pid"              | Integer    - Process identification number
 -------------------+------------------------------------------------+

A range variable

  Parameter 2       | Return Value (Parameter 1 is a range variable)
 -------------------+------------------------------------------------+
  "buffer"          | Buffer   - The buffer in which  the  range
                    |            is located
  "video"           | Keyword  - Video attribute of the range
 -------------------+------------------------------------------------+

A string variable

  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value  (Parameter 1 is a string variable)
 -------------------+------------------------------------------------+
  "self_insert"     | (1 or 0) - Indicates if printable characters are
                    |            to be inserted into the buffer if
                    |            they are not defined
  "shift_key"       | Keyword  - Keyword for the key currently used
                    |            as the shift key
  "undefined_key"   | Program  - Program called when an undefined
                    | or 0       character is entered; 0 if the
                    |            program issues the default message
 -------------------+------------------------------------------------+
 The string variable must identify either the name of a key map or a
 key-map list.
 A return integer value of (1 or 0) indicates True or False
 respectively.

A window variable

  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "visible_top"     | Integer  - Screen   line   number  of  the
                    |            visible top of the window
  "visible_bottom"  | Integer  - Screen   line   number  of  the
                    |            visible bottom of the window
                    |            (doesn't include the status line)
  "visible_length"  | Integer  - Visible  length  of  the window
                    |            (includes the status line)
 -------------------+------------------------------------------------+


  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "visible"         | (1 or 0) - Indicates  whether  window   is
                    |            mapped to the screen and is not
                    |            occluded
  "beyond_eol"      | (1 or 0) - Indicates whether the cursor is
                    |            beyond the end of  the  current
                    |            line
  "buffer"          | Buffer   - The  buffer associated with window
                    | 0          if none
  "current_row"     | Integer  - Row in  which  the  cursor  was
                    |            most recently located
  "current_column"  | Integer  - Column in which the cursor  was
                    |            most recently located
  "next"            | Window   - Next window  in VAXTPU's internal list
                    | 0          if last
  "previous"        | Window   - Previous window in VAXTPU's
                    | 0          if first
 -------------------+------------------------------------------------+


  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "original_bottom" | Integer  - Screen   line   number  of  the
                    |            bottom of the  window  when  it
                    |            was created (doesn't include the
                    |            status line)
  "original_length" | Integer  - Number of lines in  the  window
                    |            (includes status line)
  "original_top"    | Integer  - Screen line number of  the  top
                    |            of  the  window  when  it   was
                    |            created
  "shift_amount"    | Integer  - Number of columns the window is
                    |            shifted to the right or the left
 -------------------+------------------------------------------------+
  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "pad"             | (1 or 0) - Indicates whether the window is
                    |            blank padded at the right
  "scroll_amount"   | Integer  - Number of lines to scroll
  "scroll_bottom"   | Integer  - Bottom of the scrolling area  -
                    |            this  is  an  offset  from  the
                    |            bottom screen line
  "scroll_top"      | Integer  - Top of  the  scrolling  area  -
                    |            this  is an offset from the top
                    |            screen line
  "status_line"     | String   - Text of status line
                    | 0          if none
 -------------------+------------------------------------------------+
  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "status_video"    | Keyword  - If there is no video or only one
                    |            video  attribute for  the  window's
                    |            status line, the appropriate video
                    |            keyword (NONE, BLINK, BOLD, REVERSE,
                    |            UNDERLINE, or SPECIAL_GRAPHICS) is
                    |            returned;
                    | 1          if there are multiple video attributes
                    | 0          if there is no status line
  "no_video_status" | (1 or 0) - Indicates whether the video attribute
                    |            of the window's status line is NONE
  "blink_status"    | (1 or 0) - Indicates whether BLINK is one of the
                    |            video attributes of the status line
  "bold_status"     | (1 or 0) - Indicates  whether BOLD is one of the
                    |            video attributes of the status line
 -------------------+------------------------------------------------+

  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value (Parameter 1 is a window variable)
 -------------------+------------------------------------------------+
  "reverse_status"  | (1 or 0) - Indicates whether REVERSE is one of
                    |            the video attributes of the status
                    |            line
  "underline_status"| (1 or 0) - Indicates whether UNDERLINE is one of
                    |            the video attributes of the status
                    |            line
  "text"            | Keyword  - Indicates  which  keyword   was
                    |            used with SET(TEXT,window,keyword)
  "width"           | Integer  - Width of the window
  "video"           | Keyword  - If there is no video or only one video
                    |            attribute for the window, the single
                    |            video keyword (NONE, BLINK, BOLD,
                    |            REVERSE, or UNDERLINE)is returned;
                    | 0          if there are multiple video attributes
  "no_video"        | (1 or 0) - Indicates whether the video attribute
                    |            of the window is NONE
  "blink_video"     | (1 or 0) - Indicates whether BLINK is one of the
                    |            video attributes of the window
  "bold_video"      | (1 or 0) - Indicates whether BOLD is one of the
                    |            video attributes of the window
  "reverse_video"   | (1 or 0) - Indicates whether REVERSE is one of
                    |            the video attributes of the window
  "underline_video" | (1 or 0) - Indicates whether UNDERLINE is one of
                    |            the video attributes of the window
 -------------------+------------------------------------------------+

BUFFERS

  Parameter 2       | Return Value (Parameter 1 is keyword BUFFERS)
 -------------------+------------------------------------------------+
  "current"         | Buffer   - Current buffer
                    | 0          if none
  "first"           | Buffer   - First  buffer  in  VAXTPU's  internal
                    |            list of buffers***
                    | 0          if none
  "last"            | Buffer   - Last buffer in VAXTPU's internal list
                    |            of buffers***
                    | 0          if none
  "next"            | Buffer   - Next buffer in VAXTPU's internal list
                    |            of buffers***
                    | 0          if at end of list
  "previous"        | Buffer   - Preceding buffer in VAXTPU's internal
                    |            list of buffers***
                    | 0          if at beginning of list
 -------------------+------------------------------------------------+

 ***VAXTPU orders buffers according to the order in which they are
 created; the first ones created are the first in the list.

COMMAND_LINE

  Parameter 2       | Return Value (Parameter 1 is keyword COMMAND_LINE)
 -------------------+------------------------------------------------+
  "file_name"       | String   - File-spec used as a parameter when
                    |            invoking VAXTPU
  "command"         | (1 or 0) - Indicates  whether  /COMMAND   was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /COMMAND
  "command_file"    | String   - File-spec specified with /COMMAND=
  "create"          | (1 or 0) - Indicates  whether  /CREATE  was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /CREATE
 -------------------+------------------------------------------------+
  Parameter 2       | Return Value (Parameter 1 is keyword COMMAND_LINE)
 -------------------+------------------------------------------------+
  "display"         | (1 or 0) - Indicates  whether  /DISPLAY   was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /DISPLAY
  "journal"         | (1 or 0) - Indicates  whether  /JOURNAL   was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /JOURNAL
  "journal_file"    | String   - File-spec specified with /JOURNAL=
  "output"          | (1 or 0) - Indicates  whether  /OUTPUT  was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /OUTPUT
  "output_file"     | String   - File-spec specified with /OUTPUT=
  "recover"         | (1 or 0) - Indicates  whether  /RECOVER   was
                    |            specified when invoking VAXTPU;
  "read_only"       | (1 or 0) - Indicates whether  /READ_ONLY  was
                    |            specified when invoking VAXTPU;
  "section"         | (1 or 0) - Indicates  whether /SECTION  was
                    |            specified when invoking VAXTPU;
                    |            Returns 1 if defaulted to /SECTION
  "section_file"    | String   - File-spec specified with /SECTION=
 -------------------+------------------------------------------------+

DEBUG

  Parameter 2       | Return Value      (Parameter 1 is keyword DEBUG)
 -------------------+------------------------------------------------+
  " local"          | Variable  - First local variable in the previous
                    |             procedure; specifies that "next" or
                    |             "previous" will refer to locals;
                    | 0           If no more local variables
  "parameter"       | Parameter - First parameter of the previous
                    |             procedure; specifies that "next"
                    |             and "previous" will refer to
                    |             parameters;
                    | 0           If no more local parameters
  "next"            | Parameter - Next parameter in parameter list
                    | Variable  - Next local variable as declared
                    | 0         - End of list has been reached
  "previous"        | Parameter - Previous parameter in parameter list
                    | Variable  - Previous local variable as declared
                    | 0         - Beginning of list has been reached
 -------------------+------------------------------------------------+

DEFINED_KEY

  Parameter 2       | Return Value (Parameter 1 is keyword DEFINED_KEY)
 -------------------+------------------------------------------------+
  "first"           | Keyword   - Keyword of the first key in the
                    |             specified key map or key-map list
  "last"            | Keyword   - Keyword of the last key in the
                    |             specified key map or key-map list
  "next"            | Keyword   - Keyword of the next key in the
                    |             specified key map or key-map list
  "previous"        | Keyword   - Keyword of the previous key in the
                    |             specified key map or key-map list
 -------------------+------------------------------------------------+
 When Parameter1 is DEFINED_KEY the built-in procedure takes a string
 as a third parameter.  The string specifies the name of either the
 key map or key-map list to be searched.

 Use string constant "first", before using "next". Use "last" before
 using "previous". Note that "current" is not valid when Parameter1
 is DEFINED_KEY or KEY_MAP, although it is valid when Parameter1 is
 KEY_MAP_LIST.

KEY_MAP

  Parameter 2       | Return Value (Parameter 1 is keyword KEY_MAP)
 -------------------+------------------------------------------------+
  "first"           | String   -  Name of the first key map in the
                    |             key-map list
  "last"            | String   -  Name of the last key map in the
                    |             key-map list
  "next"            | String   -  Name of the next key map in the
                    |             key-map list
  "previous"        | String   -  Name of the previous key map in the
                    |             key-map list
 -------------------+------------------------------------------------+
 When Parameter1 is KEY_MAP, the built-in procedure takes a string
 as a third parameter.  The string specifies the name of the key-map
 list to be searched.

 Use string constant "first", before using "next". Use "last" before
 using "previous". Note that "current" is not valid when Parameter1
 is DEFINED_KEY or KEY_MAP, although it is valid when Parameter1 is
 KEY_MAP_LIST.

KEY_MAP_LIST

  Parameter 2     | Return Value (Parameter 1 is keyword KEY_MAP_LIST)
 -----------------+--------------------------------------------------+
  "current"       | String   -  Name of the current key-map list
  "first"         | String   -  Name of the first key-map list
  "last"          | String   -  Name of the last key-map list
  "next"          | String   -  Name of the next key-map list
  "previous"      | String   -  Name of the previous key-map list
 -----------------+--------------------------------------------------+
 Use string constants "current" or "first", before using "next". Use
 "current" or "last" before using "previous".

PROCESS

  Parameter 2       | Return Value    (Parameter 1 is keyword PROCESS)
 -------------------+------------------------------------------------+
  "first"           | Process  - First  process  in  VAXTPU's internal
                    |            list of processes***
                    | 0          if none
  "last"            | Process  - Last  process  in  VAXTPU's  internal
                    |            list of processes***
                    | 0          if none
  "next"            | Process  - Next in  VAXTPU's  internal  list  of
                    |            processes***
                    | 0          if at end of the list
  "previous"        | Process  - Preceding   process    in    VAXTPU's
                    |            internal list of processes***
                    | 0          if at beginning of list
 -------------------+------------------------------------------------+

 ***VAXTPU  orders processes according to the order in which they are
 created; the first ones created are the first in the list.

SCREEN

  Parameter 2       | Return Value     (Parameter 1 is keyword SCREEN)
 -------------------+------------------------------------------------+
  "ansi_crt"        | (1 or 0) - Indicates  whether the terminal is
                    |            an ANSI_CRT
  "current_column"  | Integer  - Column number of the current column
                    |            as of the most recent screen update
  "current_row"     | Integer  - Screen line number of the current row
                    |            as of the most recent screen update
  "dec_crt"         | (1 or 0) - Indicates  whether the terminal is
                    |            a DEC_CRT
 -------------------+------------------------------------------------+

  Parameter 2       | Return Value     (Parameter 1 is keyword SCREEN)
 -------------------+------------------------------------------------+
  "dec_crt2"        | (1 or 0) - Indicates  whether the terminal is
                    |            a DEC_CRT_2
  "edit_mode"       | (1 or 0) - Indicates  whether the terminal is
                    |            set to edit mode
  "eightbit"        | (1 or 0) - Indicates  whether  the   terminal
                    |            uses eightbit characters
  "line_editing"    | Keyword  - Current method of line editing
                    | or 0       (Insert or Overstrike), 0 if none
  "original_width"  | Integer  - Physical width of the screen when
                    |            you invoked VAXTPU
  "scroll"          | (1 or 0) - Indicates whether the terminal has
                    |            scrolling regions, DEC_CRT
  "visible_length"  | Integer  - Page length of the terminal
  "vt100"           | (1 or 0) - Indicates  whether the terminal is
                    |            in the VT100 series
  "vt200"           | (1 or 0) - Indicates  whether the terminal is
                    |            in  the VT200 series
  "vk100"           | (1 or 0) - Indicates  whether the terminal is
                    |            a GIGI
  "width"           | Integer  - Current physical width of the screen
 -------------------+------------------------------------------------+
  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value     (Parameter 1 is keyword SCREEN)
 -------------------+------------------------------------------------+
  "auto__repeat"    | (1 or 0) - Indicates whether auto_repeat
                    |            feature is on
  "prompt_length"   | Integer  - Number of lines in the prompt area
  "prompt_row"      | Integer  - Screen line number  at  which  the
                    |            prompt area begins
  "screen_update"   | (1 or 0) - Indicates whether screen  updating
                    |            is turned on
 -------------------+------------------------------------------------+

SYSTEM

  Parameter 2       | Return Value     (Parameter 1 is keyword SYSTEM)
 -------------------+------------------------------------------------+
  "display"         | (1 or 0) - Indicates whether the supported input
                    |            is a terminal. Returns 0 if the VAXTPU
                    |            session is running in batch mode
  "journal_file"    | String   - Name of the journal file
  "section_file"    | String   - Name of section file used when VAXTPU
                    |            was invoked
  "update"          | Integer  - Update number of this  version  of
                    |            VAXTPU
  "version"         | Integer  - Version number of VAXTPU
 -------------------+------------------------------------------------+

  The following items are established or changed using the
  SET built-in.

  Parameter 2       | Return Value     (Parameter 1 is keyword SYSTEM)
 -------------------+------------------------------------------------+
  "bell"            | Keyword  - ALL or BROADCAST indicating whether
                    |            SET (BELL) is ON for either;
                    | 0          if SET (BELL) is OFF
  "facility_name"   | String   - Current facility name
  "informational"   | (1 or 0) - Indicates whether SET (INFORMATIONAL)
                    |            is on
  "journaling_      | Integer  - The  number that indicates how
   frequency"       |            frequently records are written to
                    |            the journal file
  "message_flags"   | Integer  - Current  value  of  messsage  flag
                    |            setting if changed using SET built-in
  "shift_key"       | Keyword  - Value of the key set with SET
                    |            (SHIFT_KEY) for the current buffer
  "success"         | (1 or 0) - Indicates whether SET (SUCCESS) is on
  "timed_message"   | String   - Text  that  VAXTPU  displays  at  one
                    | or 0       second intervals in the prompt area

WINDOWS

  Parameter 2       | Return Value    (Parameter 1 is keyword WINDOWS)
 -------------------+------------------------------------------------+
  "current"         | Window   - Current window on the screen;
                    | 0          if none
  "first"           | Window   - First  window  in  VAXTPU's  internal
                    |            list of windows***
                    | 0          if none
  "last"            | Window   - Last window in VAXTPU's internal list
                    |            of windows***
                    | 0          if none
  "next"            | Window   - Next window in VAXTPU's internal list
                    |            of windows***
                    | 0          if pointing at last window
  "previous"        | Window   - Preceding window in VAXTPU's internal
                    |            list of windows***
                    | 0          if pointing at first window
 -------------------+------------------------------------------------+

 ***VAXTPU  orders  windows  according  to their "original top"
 line number. If multiple windows have  the same top line
 number, the most recently created window comes first in
 VAXTPU's list of windows.

Examples

 my_buffer := GET_INFO (BUFFERS, "current");

 This assignment statement stores the pointer to the current buffer
 in the variable my_buffer.


 my_string := GET_INFO (my_buffer, "file_name");

 This assignment statement stores the name of the input file for
 my_buffer in the variable my_string.

HELP_TEXT

 Invokes the VMS HELP utility.  You must specify the help library that
 will be used for help information, the initial library topic, the
 prompting mode for the HELP utility, and the buffer to which the help
 information will be written.  If you enter only a file name, the HELP
 utility provides a default device (SYS$HELP:) and default file type
 (.HLB).

 Format
    HELP_TEXT (string1, string2, keyword, buffer)

 string1  The name of the help library to use.
 string2  The initial library topic.
 keyword  Specify whether the prompting mode for the library is ON or OFF.
 buffer   The buffer to which the help information will be written.

Additional information available:

Example

Example

 HELP_TEXT ('tpuhelp', (READ_LINE ('Topic:  ')), OFF,
 second_buffer)

 This command prompts the user to provide the topic for the
 HELP utility.  The information on that topic that is in the
 tpuhelp library will be written to second_buffer.

INDEX

 Locates a character or a substring within a string and returns its
 location within the string.

 Format
    integer := INDEX (string1, string2)

 string1  A string within which you want to find a character
          or a substring.
 string2  A character or a substring whose leftmost character
          location you want to find within string1.

Additional information available:

Example

Example

 loc := INDEX ('1234567','67')

 This assignment statement stores an integer value of 6 in the
 variable loc, since the substring 67 is found starting at
 character position 6 within the string 1234567.

INT

 Converts a string that consists of numeric characters into an
 integer.  This built-in returns 0 if the string is not a number.

 Format
    integer := INT (string)

 string   A string that consists of numeric characters.

Additional information available:

Example

Example

 user_int := INT ('12345')

 This assignment statement converts the string "12345" into an
 integer value and stores it in the variable user_int.

JOURNAL_CLOSE

 Closes an open journal file (if one exists for your session) and
 saves the journal file.

 Format
    JOURNAL_CLOSE

JOURNAL_OPEN

 Opens a journal file and starts making a copy of your editing
 session by recording every keystroke and command that you execute.

 Format
    [string2 :=] JOURNAL_OPEN (string1)

 string   The name of the journal file that will be created for your
          editing session.

Additional information available:

Example

Example

 JOURNAL_OPEN ('test.fil')

 This statement causes VAXTPU to open a file named test.fil as
 the journal file for your editing session.  VAXTPU uses your
 current default device and directory to complete the file
 specification.

KEY_NAME

 Format
    keyword := KEY_NAME ({string|keyword} [,SHIFT_KEY])

 string     A string that is the value of a key from the keyboard.
 keyword    A VAXTPU keyname for a key.
 SHIFT_KEY  A keyword that refers to the VAXTPU shift key (PF1 by
            default). Its use here indicates that the keyword returned
            includes one or more shift keys.

Additional information available:

Examples

Examples

 key1 := KEY_NAME ('Z')
 This assignment statement creates the keyname key1 for the
 keyboard key Z.

 key2 := KEY_NAME (KP5, SHIFT_KEY)
 This example uses KEY_NAME to create a keyname for a combination
 of keys.

 key3 := KEY_NAME (ASCII (10))
 This assignment statement creates the keyname key3 for the line
 feed control character.

LAST_KEY

 Returns a VAXTPU keyword for the last key you entered.  If you are
 replaying a learn sequence, it returns a keyword for the key that
 defines the learn sequence you replayed.

 Format
    keyword := LAST_KEY

Additional information available:

Example

Example

 keyz := last_key

 This assignment statement stores the keyword for the last key
 you typed in the variable name keyz.


 The following procedure prompts the user for input for key
 definitions:

 PROCEDURE user_define_key
    def := READ_LINE ('Definition: ');
    key := READ_LINE ('Press key to define.',1);
    IF LENGTH (key) > 0
       THEN key := KEY_NAME (key)
       ELSE key := LAST_KEY;
    ENDIF;
    DEFINE_KEY (def, key);
 ENDPROCEDURE

LEARN_BEGIN

 LEARN_BEGIN/LEARN_END

 These built-ins save all keystrokes typed between LEARN_BEGIN and
 LEARN_END.  LEARN_BEGIN starts saving all keystrokes that you
 type.  LEARN_END stops the "learn mode" of VAXTPU and returns a
 learn sequence that consists of all the keystrokes that you
 entered.

 Format
    LEARN_BEGIN (keyword)
                .
                .
                .
    learn := LEARN_END

LEARN_END

 LEARN_BEGIN/LEARN_END

 These built-ins save all keystrokes typed between LEARN_BEGIN and
 LEARN_END.  LEARN_BEGIN starts saving all keystrokes that you
 type.  LEARN_END stops the "learn mode" of VAXTPU and returns a
 learn sequence that consists of all the keystrokes that you
 entered.

 Format
    LEARN_BEGIN (keyword)
                .
                .
                .
    learn := LEARN_END

LENGTH

 Returns an integer that is the number of character positions in a
 string or a range.

 Format
    integer := LENGTH ({string|range})

 string   A string whose length you want to determine.
 range    A range whose length you want to determine.

Additional information available:

Example

Example

 str_len := LENGTH ('Don Quixote')

 This assignment statement stores the number of characters in
 the string "Don Quixote" in the variable str_len.  In this
 example, the integer value is 11.


 user_how_long := LENGTH (my_range)

 This assignment statement stores the number of character
 positions (excluding line terminators) in my_range in the
 variable user_how_long.

LINE_BEGIN

 Returns a pattern that matches the beginning-of-line condition.

 Format
    pattern := LINE_BEGIN

Additional information available:

Example

Example

 The following procedure removes all runoff commands from a
 file by searching for a pattern that has a dot (.) at the
 beginning of a line and then removing the lines that match
 this condition.

 PROCEDURE user_remove_dsrlines
    LOCAL s1, pat1;

    pat1 := LINE_BEGIN & '.';
    LOOP
       s1 := SEARCH (pat1, FORWARD);
       EXITIF s1 = 0;
       POSITION (s1);
       ERASE_LINE;
    ENDLOOP
 ENDPROCEDURE

LINE_END

 Returns a pattern that matches the end-of-line condition.

 Format
    pattern := LINE_END

Additional information available:

Example

Example

 The following procedure moves the current character position
 to the end of the line, if you are not already at the end of
 the current line.

 PROCEDURE user_end_of_line
    eol_pattern := LINE_END;
    eol_range := SEARCH (eol_pattern, FORWARD);
    IF eol_range <> 0
       THEN POSITION (eol_range);
    ENDIF;
 ENDPROCEDURE

LOOKUP_KEY

 Returns the executable code or the comment that is associated with
 the key you specify.  The code can be returned as a program or as
 a learn sequence.  The comment is returned as a string.

 Format
    {program|learn|integer|string2} :=
    LOOKUP_KEY (keyword1, keyword2 [,string1])

 keyword1  A VAXTPU keyname for a key or a combination of keys.
 keyword2  The valid keywords are PROGRAM, COMMENT and KEY_MAP:
           PROGRAM - Specifies that either a program or a learn
                     sequence will be returned if the key was defined.
                     If the key was not defined, zero is returned.
           COMMENT - Specifies that the comment string will be returned.
                     If no comment was given, a null string will
                     be returned.
           KEY_MAP - Specifies that the string given for the key map
                     when the key was defined with DEFINE_KEY is
                     returned.
 string1   An optional string that causes the procedure to return
           the requested information from the specified key map,
           or from the first definition for the key in the specified
           key-map list.  If neither a key map nor a key-map list is
           specified, the first definition in the key-map list bound
           to the current buffer is returned.

Additional information available:

Example

Example

 programx := LOOKUP_KEY (key1, PROGRAM)

 This assignment statement returns the executable code that is
 associated with key1.  The second keyword PROGRAM indicates
 that the result will be returned in a program or a learn data
 type.


 The following procedure displays in the message area the
 comment that you included with your key definition for the
 last key that you typed:

 PROCEDURE user_what_is_comment
    MESSAGE (LOOKUP_KEY (LAST_KEY, COMMENT));
 ENDPROCEDURE

MAP

 Associates a buffer with a window and causes the window to become
 visible on the screen.  Before using MAP you must already have
 created the buffer and the window that you specify as parameters.
 See CREATE_BUFFER and CREATE_WINDOW.

 Format
    MAP (window, buffer)

 window   The window that you want to map to the screen.
 buffer   The buffer you want to associate with the window.


Additional information available:

Example

Example

 MAP (main_window, main_buffer)

 This command associates the main_buffer with main_window and
 maps the main window to the screen.  You must have
 established the main_buffer and the main window with
 CREATE_BUFFER and CREATE_WINDOW before you can use them as
 parameters for MAP.


 The following procedure creates a message buffer and a
 message window.  It then associates the message buffer with
 the message window and maps the message window to the screen.

 PROCEDURE user_message_window
     message_buffer := CREATE_BUFFER ("message");
     SET (EOB_TEXT, message_buffer, ");
     SET (NO_WRITE, message_buffer);
     SET (SYSTEM, message_buffer);
     message_window := CREATE_WINDOW (23, 2, OFF);
     SET (VIDEO, message_window, NONE);
     MAP (message_window, message_buffer);
 ENDPROCEDURE

MARK

 Returns a marker for the current character position in the current
 buffer.  You must specify how the marker is to be displayed on the
 screen (no special video, blinking, bolded, reverse video, or
 underlined).

 Format
    marker := MARK (keyword)

 keyword  The valid keywords are: NONE, BLINK, BOLD,
          REVERSE, and UNDERLINE.


Additional information available:

Example

Example

 user_mark_under := MARK (UNDERLINE)

 This assignment statement places a marker at the row and
 column position that corresponds to the current character
 position.  The character tied to the marker will be
 underlined.

MATCH

 Returns a pattern that matches a sequence of characters starting
 at the current character position and continuing up to and
 including all the characters specified in the parameter string.
 For a string to match a pattern that is returned by the MATCH
 built-in, it must contain all of the characters that you specify
 as a parameter.  The pattern that MATCH returns does not cross
 record (line) boundaries.

 Format
    pattern := MATCH (string)

 string   A string that contains the characters that you want
          to be the final part of the pattern.

Additional information available:

Examples

Examples

 pat1 := MATCH ('abc')

 This assignment statement stores in pat1 a pattern that will
 match a string of characters starting with the current
 character position up to and including the characters "abc".


 The following procedure finds text within double parentheses.
 It moves the current character position to the beginning of
 the parenthetical text, if it exists.

 PROCEDURE user_double_parens
    paren_text    := '((' & MATCH ('))');
    found_range   := SEARCH (paren_text, FORWARD, NO_EXACT);
    IF found_range = 0   ! No match
       THEN MESSAGE  ('No match found.');
       ELSE POSITION (found_range);
    ENDIF
 ENDPROCEDURE

MESSAGE

 Puts the characters in the string or range that you specify into
 the message buffer, if one exists (by default, VAXTPU looks for a
 buffer that is named MESSAGE_BUFFER).  If there is no
 MESSAGE_BUFFER, VAXTPU displays the message at the current
 location on the device pointed to by SYS$OUTPUT (usually your
 terminal).

 Format
    MESSAGE ({string|range})

 string   A string that you want displayed in the message area.
 range    A range that you want displayed in the message area.

Additional information available:

Examples

Examples

 MESSAGE ('Hello')

 This command writes the text "Hello" in the message area.


 The following procedure determines whether the cursor is at
 the end of the line.  It sends a text message to the message
 area on the screen about the position of the cursor.

 PROCEDURE user_on_eol
    ! test if at eol, return true or false
    MOVE_HORIZONTAL (1);
    IF CURRENT_OFFSET = 0   !then we are on eol
       THEN
          user_on_end_of_line := 1;   !return true
          MESSAGE ("Cursor at end of line");
       ELSE
          user_on_end_of_line := 0;   !return false
          MESSAGE ("Cursor is not at the end of line");
    ENDIF;
    MOVE_HORIZONTAL (-1);   !move back
 ENDPROCEDURE

MOVE_HORIZONTAL

 Changes the current character position in the current buffer by
 the number of characters you specify.

 Format
      MOVE_HORIZONTAL (integer)

 integer  The signed (+/-) integer value that indicates the number
          of characters the current character position should be
          moved. A positive integer causes movement toward the end
          of the buffer. A negative integer causes movement toward
          the beginning of the buffer.

Additional information available:

Example

Example

 The following procedure moves text by sections that are eight
 lines long, and uses MOVE_HORIZONTAL to put the current
 character position at the beginning of the line.

 PROCEDURE user_move_by_lines
    IF CURRENT_DIRECTION = FORWARD
       THEN
          MOVE_VERTICAL (8)
       ELSE
          MOVE_VERTICAL(- 8)
    ENDIF;
    MOVE_HORIZONTAL (-CURRENT_OFFSET);
 ENDPROCEDURE

MOVE_TEXT

 Moves the text you specify.  When you move text with range and
 buffer parameters, you remove it from its original location.  If
 the current buffer is in insert mode, the text you specify will be
 inserted before the current position in the current buffer.  If
 the current buffer is in overstrike mode, the text you specify
 will replace text starting at the current position and continuing
 for the length of the string, range, or buffer.

 Format
    MOVE_TEXT ({string|range|buffer})

 string   The text that you want to move. Text is not removed
          from its original location with this argument.

 range    The range that contains the text you want to move.

 buffer   The buffer that contains the text you want to move.

Additional information available:

Example

Example

 MOVE_TEXT (main_buffer)

 If you are using insert mode for text entry, this command
 causes the text from main_buffer to be placed in front of the
 current position in the current buffer.  The text is removed
 from main_buffer.

MOVE_VERTICAL

 Changes the current character position in the current buffer by
 the number of characters you specify.

 Format
    MOVE_VERTICAL (integer)

 integer  The signed (+/-) integer value that indicates the number
          of rows that the current position should be moved. A
          positive integer causes movement toward the end of the
          buffer. A negative integer causes movement toward the
          beginning of the buffer.


Additional information available:

Example

Example

 The following procedure moves text by sections that are eight
 lines long.

 PROCEDURE user_move_8_lines
    IF CURRENT_DIRECTION = FORWARD
       THEN
          MOVE_VERTICAL (8)
       ELSE
          MOVE_VERTICAL (- 8)
    ENDIF;
    MOVE_HORIZONTAL(- CURRENT_OFFSET);
 ENDPROCEDURE

NOTANY

 Returns a pattern that matches any single character not in the
 string that is used as a parameter.

 Format
    pattern := NOTANY (string)

 string  A string that contains characters that will cause a
         match of the pattern to fail.

Additional information available:

Example

Example

 pat1 := NOTANY ('XYZ')

 This assignment statement creates a pattern that will match
 the first character that is not an X, a Y, or a Z.  The match
 will fail if a character (other than X, Y, or Z) is not
 found.

POSITION

 Establishes the current character position in the editing context.
 You can position to a buffer, a marker, a range, or a window.

 Format
    POSITION ({buffer|marker|range|window})

 buffer   The buffer in which you want to place the current
          character position; it becomes the last position you
          occupied in the buffer.
 marker   The marker to which you want to tie the current
          character position.
 range    The range in which you want to place the current
          character position; it will be at the beginning
          of the range.
 window   The window in which you want to place the current
          character position. The window must be mapped to
          the screen. The current character position becomes
          the row and column on the screen that you occupied
          the last time you were positioned in this window.

Additional information available:

Examples

Examples

 user_mark := MARK(NONE);
 POSITION (user_mark)

 These statements set the current character position to the
 marker associated with the variable user_mark.


 The following procedure changes position from one window to
 another.

 PROCEDURE user_change_windows
    IF CURRENT_WINDOW = main_window
       THEN POSITION (extra_window);
       ELSE POSITION (main_window);
    ENDIF;
 ENDPROCEDURE

QUIT

 Leaves the editor without writing to a file.  If you have modified
 any buffers that have not been SET (NO_WRITE,...), VAXTPU will
 tell you that you have modified buffers and will ask whether you
 want to quit.  Enter Y(es) if you want to quit without writing out
 any modified buffers.  Enter N(o) if you want to retain the
 modifications you have made and return to the editor.

 A special use of the QUIT built-in is at the end of your section
 file when you are compiling it for the first time.

 Format
    QUIT

Additional information available:

Examples

Examples

 QUIT

 This command returns the editor to the caller.  If you have
 modified any buffers, you will see the following prompt:

 Buffer modifications will not be saved, continue quitting (Y or N)?

 Enter Y(es) if you want to quit and not save the
 modifications.  Enter N(o) if you want to return to the
 editor.


 The following example contains statements similar to those in
 the last part of the EDTSECINI.TPU file that creates the EDT
 Keypad Emulator.  The SAVE statement creates a section file
 that is saved in binary format.  The QUIT statement causes an
 exit from VAXTPU without any changes to the file
 EDTSECINI.TPU.

    .
    .
    .
 POSITION (main_window);
 tpu$local_init;
 edt$define_keys;  ! bind keys
 SAVE (MY_EDTSECINI.TPU$SECTION');
 QUIT;

READ_CHAR

 Stores the next character entered from the keyboard in a string
 variable.  The character read by READ_CHAR is not echoed on the
 screen; therefore, the cursor position does not move.  READ_CHAR
 does not process escape sequences.

 Format
    string := READ_CHAR

Additional information available:

Examples

Examples

 new_char := READ_CHAR

 This assignment statement stores the next character that is
 entered on the keyboard in the string new_char.


 The following procedure enters the next character that is
 entered from the keyboard in the current buffer.  If a key
 that sends an escape sequence is pressed, the entire escape
 sequence is added to the buffer, as if it were regular text.

 PROCEDURE user_quote
    COPY_TEXT (READ_CHAR);
 ENDPROCEDURE

READ_FILE

 Reads a file and adds the contents of the file immediately before
 the current line in the current buffer.  READ_FILE optionally
 returns a string containing the file specification of the file
 read.  VAXTPU writes a message indicating how many records (lines)
 were read.

 Format
    [string2 :=] READ_FILE (string1)

 string1   A string that is the name of the file you want to read
          and include in the current buffer.


Additional information available:

Examples

Examples

 READ_FILE ('login.com')

 This statement reads the file login.com from your current
 device and directory and adds it to your current buffer.


 The following procedure creates a second window and a second
 buffer and maps the window to the screen.  The procedure also
 prompts the user for a file name to include in the buffer and
 defines the editor SHIFT_KEY (PF1 by default) and W key
 combination as the key by which to move to the second window.

 PROCEDURE user_two_windows
    w2 := CREATE_WINDOW (1, 10, ON);
    b2 := CREATE_BUFFER ('buf2');
    MAP (w2, b2);
    READ_FILE (READ_LINE ('Enter file name for 2nd window : '));
    POSITION (BEGINNING_OF (b2));
    DEFINE_KEY ('POSITION (w2)', KEY_NAME ("W", SHIFT_KEY));
 ENDPROCEDURE

READ_KEY

 Waits for you to press a key and then returns the keyword for that
 key.  The key that is read by READ_KEY is not echoed on the
 terminal screen.  This built-in should be used rather than
 READ_CHAR when you are entering escape sequences, control
 characters, or any characters other than text characters.
 READ_KEY processes escape sequences and VAXTPU's SHIFT_KEY (PF1 by
 default).

 Format
    keyword := READ_KEY


Additional information available:

Examples

Examples

 my_key := READ_KEY

 This assignment statement reads the next key that is entered
 and stores the keyword for that key in the variable my_key.


 The following procedure sets the SHIFT_KEY to the last (that
 is, current) key, reads in the next key, and returns the
 keyname for the shifted key.  VAXTPU does not save the
 SHIFT_KEY setting from session to session.  Use the
 DEFINE_KEY built-in with the variable key_to_shift that is
 returned if you want to save the SHIFT_KEY that you define
 from session to session.

 PROCEDURE user_get_shiftkey
    ! Keyword for key pressed after shift key
    LOCAL key_to_shift;

    SET (SHIFT_KEY, LAST_KEY);
    key_to_shift := KEY_NAME (READ_KEY, SHIFT_KEY);
    RETURN (key_to_shift);
 ENDPROCEDURE

READ_LINE

 Displays the text that you specify as a prompt for input and reads
 the information entered in response to the prompt.  You can
 specify the maximum number of characters to be read.  READ_LINE
 returns a string that holds the data that is entered in response
 to the prompt.  By default, the text you specify as a prompt will
 be written in the PROMPT_AREA on the screen.

 If READ_LINE terminates because it reaches the limit of characters
 specified as the second parameter, the last character read becomes
 the last key.  Example 2 is a procedure that tests for the last
 key entered in a prompt string.



 Format
    string2 := READ_LINE [(string1 [,integer])]

 string1   A string that is the text to be used as a prompt for
           input.
 integer   Indicates how many characters to read from the input
           entered in response to the prompt. The maximum number is
           132.

Additional information available:

Examples

Examples

 my_prompt := READ_LINE ('Enter key definition:', 1)

 This assignment statement displays the text "Enter key
 definition:" in the PROMPT_AREA, and stores the first
 character of the user's response in the variable my_prompt.


 The following procedure prompts for 3 characters and stores
 them in the variable my_input.  It then tests for the last
 key entered.

 PROCEDURE user_test_lastkey
 LOCAL my_key, lk;

    my_input := READ_LINE ('Enter 3 characters:', 3);
    !Press the keys 'ABC'
    my_key := LAST_KEY;
    IF my_key = KEY_NAME ('C')
       THEN
          MESSAGE ("C key") ELSE MESSAGE ('error') ENDIF;
 ENDPROCEDURE

REFRESH

 Repaints the whole screen.  It erases any extraneous characters,
 such as those caused by noise on a communication line, and
 repositions the text so that the screen represents the last known
 state of the editing context.  REFRESH causes a redrawing of every
 line of every window that is mapped to the screen.  The prompt
 area is erased.  This built-in causes the screen to change
 immediately.  Even if REFRESH is issued from within a procedure,
 the action takes place immediately; VAXTPU does not wait until the
 entire procedure is completed to execute the REFRESH built-in.

 Format
    REFRESH

Additional information available:

Example

Example

 REFRESH

 The following procedure removes the contents of the
 message_buffer and then repaints the whole screen.

 PROCEDURE user_repaint
    ERASE (message_buffer);
    REFRESH;
 ENDPROCEDURE

REMAIN

 Returns a pattern that will match any string starting at the
 current character position and continuing to the end of the
 current line.  The pattern that is returned does not cross line
 boundaries.

 Format
    pattern := REMAIN

Additional information available:

Example

Example

 pat1 := LINE_BEGIN & '!' & REMAIN

 This assignment statement stores in the variable pat1 a
 pattern that will match all lines that have an exclamation
 point at the beginning of the line.

REMOVE_KEY_MAP

 Removes key maps from key-map lists.

 Format
    REMOVE_KEY_MAP (string1, string2 [,ALL])

 string1   A quoted string, or a variable name representing
           a string constant, that specifies the name of the
           key-map list containing the key map to be removed.

 string2   A quoted string, or a variable name representing
           a string constant, that specifies the name of the
           key map to be removed from the key-map list.

 ALL       This keyword is an optional argument. It specifies
           that all the key maps with the name specified by
           string2 in the key-map list are to be removed.

Additional information available:

Example

Example

 user$keymap_1 := CREATE_KEY_MAP ("keymap_1");
 user$keymap_2 := CREATE_KEY_MAP ("keymap_2");
 user$keymap_list := CREATE_KEY_MAP_LIST ("keymap_list", user$keymap_1,
                                          user$keymap_2);
 ADD_KEY_MAP (user$keymap_list, "last", user$keymap_1);
      .
      .
      .
 SHOW (KEY_MAP_LISTS);
      .
      .
      .
 REMOVE_KEY_MAP (user$keymap_list, user$keymap_1, ALL);
      .
      .
      .
 SHOW (KEY_MAP_LISTS);


 In this example, a key-map list, named KEYMAP_LIST, is
 created.  The call to SHOW (KEY_MAP_LISTS) shows that the
 key-map list contains three key maps:  KEYMAP_1, KEYMAP_2,
 and KEYMAP_1 again.  After the call to REMOVE_KEY_MAP, the
 call to SHOW (KEY_MAP_LISTS) shows that the key-map list
 contains only KEYMAP_2.

SAVE

 Writes the binary form of all currently defined procedures,
 variables, and key definitions to the VAXTPU section file you
 specify.  SAVE is used to add to or create VAXTPU section files.
 Section files enable VAXTPU interfaces to start up quickly because
 they contain the following items in binary form:
  o  All compiled PROCEDURE...ENDPROCEDURE statements.
  o  Every variable that has been created (only the variable's name
     is saved, not its contents).
  o  Every key definition that binds a statement, procedure,
     program, or a learn sequence to a key (this includes the
     comments that you add to key definitions).



 Format
    SAVE (string)

 string    A string that is a valid VMS file specification. You
           should supply a full VMS file specification, including
           device and directory.

Additional information available:

Example

Example

 SAVE ('SYS$LOGIN:mysection.TPU$SECTION')

 This command, issued just before exiting from the editor,
 will add all of the procedure definitions, key definitions,
 and variables from your current editing session to the
 section file with which you invoked VAXTPU.  The new file
 that you specify, SYS$LOGIN:mysection.TPU$SECTION, will
 contain initialization items from the original section file
 and from your editing session.

 To invoke VAXTPU with the new, combined section file, enter
 the following command at DCL level:

 $ EDIT/TPU/SECTION=SYS$LOGIN:mysection.TPU$SECTION

SCAN

 Returns a pattern that matches the longest string of characters
 that does not contain any of the characters included in the
 parameter string.  The pattern that is returned does not cross
 record (line) boundaries.  The pattern starts at the current
 character position and continues to the end of the current line or
 until it finds one of the characters in the string used as a
 parameter.

 Format
    pattern := SCAN (string)

 string    A string that contains the characters that you do not want
           to match.

Additional information available:

Examples

Examples

 pat1 := SCAN ('abc')

 This assignment statement stores a pattern that will match
 the longest string of characters that does not contain a, b,
 or c in pat1.


 The following procedure identifies parenthetical text within
 a single line.  It moves the current character position to
 the beginning of the parenthetical text, if it exists.

 PROCEDURE user_find_parens
    Paren_text    := ANY('(') & SCAN (')');
    found_range   := SEARCH (Paren_text, FORWARD, NO_EXACT);
    IF found_range = 0   ! No parentheses.
       THEN MESSAGE  ('No parentheses found.');
       ELSE POSITION (found_range);
    ENDIF
 ENDPROCEDURE

SCANL

 Returns a pattern that will match the longest string of characters
 that does not contain any of the characters included in the
 parameter string.  SCANL crosses record boundaries.

 Format
    pattern := SCANL (string)

Additional information available:

Example

Example

 pat1 := SCANL ('abc')

 This assignment statement stores in pat1 the longest string
 starting at the current character position that does not
 contain a, b, or c.

SCROLL

 Moves the lines of text in the buffer up or down on the screen by
 the number of lines you specify.  The cursor does not move but
 stays positioned at the same relative screen location.  The
 current character position will be different from the character
 position that was current before you issued the scroll command.
 SCROLL optionally returns an integer that indicates the number and
 direction of lines actually scrolled.  (A negative number
 indicates the number of lines scrolled upwards; a positive number
 indicates the number of lines scrolled downwards.) The value of
 integer1 may differ from what was specified in integer2.

 If you omit the second parameter, the text will scroll
 continuously until it reaches a buffer boundary or until you press
 a key.  If the current direction of the buffer is FORWARD, the
 text will scroll to the end of the buffer.  If the current
 direction of the buffer is REVERSE, the text will scroll to the
 beginning of the buffer.  If you press a key that has commands
 bound to it, the scrolling will stop and VAXTPU will execute the
 commands bound to the key.

 Format
    [integer1 :=] SCROLL (window [,{+|-}integer2])

 window   The window associated with the buffer whose text you
          want to scroll.
 integer  The signed (+/-) integer value that indicates how many
          lines you want the text to scroll. A positive integer
          causes the text in the window to scroll up from the bottom
          of the screen to the top. A negative integer causes the
          text in the window to scroll down from the top of the screen
          to the bottom. If you specify 0, no scrolling occurs.

Additional information available:

Examples

Examples

 SCROLL (main_window,+10)

 This command causes the text of the buffer that is mapped to
 the main_window to scroll up 10 lines.

 SET (FORWARD, my_buffer); SCROLL (my_window)

 These commands cause the text in my_buffer (that is mapped to
 my_window) to scroll up until the end of my_buffer is
 reached.

SEARCH

 Looks for a particular arrangement of characters and returns a
 range that contains the matching characters in the current buffer.
 If SEARCH fails to find a match, a 0 is returned and an error is
 signaled.

 Format
    range := SEARCH ({string|pattern}, keyword1 [,keyword2])

 string    A string that you want to match.
 pattern   A pattern that you want to match.
 keyword1  Indicates the direction of the search. The valid keywords
           are FORWARD and REVERSE.
 keyword2  Indicates whether the matching characters must be the same
           case. The valid keywords are EXACT and NO_EXACT.

Additional information available:

Examples

Examples

 user_range := SEARCH ('Reflections of MONET', FORWARD, NO_EXACT)

 If you were searching a buffer in which the string
 "Reflections of Monet" appeared, this assignment statement
 would store the characters "Reflections of Monet" in the
 range user_range.  The search would find a successful match
 even though the characters in the word MONET do not match in
 case, because you specified NO_EXACT.




 The following procedure searches for the word "CHAPTER"
 appearing at the beginning of a line.  If it finds it, the
 procedure positions to the beginning of the string.  If it
 doesn't find it, it writes an appropriate message in the
 message buffer.

 PROCEDURE user_find_chap
    chap    := LINE_BEGIN & 'CHAPTER';
    found_range   := SEARCH (chap, FORWARD, NO_EXACT);
    IF found_range = 0   ! No match found.
       THEN MESSAGE  ('CHAPTER not found.');
       ELSE POSITION (found_range);
    ENDIF
 ENDPROCEDURE

SELECT

 Returns a marker for the current character position in the current
 buffer.  You must specify how the marker is to be displayed on the
 screen (no special video, reverse video, bolded, blinking, or
 underlined).

 The marker returned by SELECT indicates the first character in a
 select range.  The video attribute that you specify for the marker
 will apply to all the characters in a select range.  For
 information on creating a select range, see SELECT_RANGE.  Only
 one select marker per buffer can be active at any one time.  If a
 buffer is associated with more than one visible window, the select
 range will be displayed in only one window (the current or most
 recent window).

 Format
    marker := SELECT (keyword)

 keyword  Specifies how the marker is to be displayed. The valid
          keywords are NONE, BOLD, BLINK, REVERSE, and UNDERLINE.

Additional information available:

Examples

Examples

 The following procedure creates a bold marker that is used as
 the beginning of a select region.  As you move the cursor,
 the characters that you select will be bolded.  To turn off
 the selection of characters set the variable
 user_g_beginning_of_select to 0.

 PROCEDURE user_start_select
    user_g_beginning_of_select := SELECT(BOLD);
 ENDPROCEDURE

SELECT_RANGE

 Returns a range that contains all the characters between the
 marker established with the SELECT built-in and the current
 character position.  SELECT_RANGE does not include the character
 at the position which ends the range in the selected range.

 The procedure for selecting a section of text is the following:
  o  Use the SELECT built-in to place a marker at the beginning of
     the section you want to select (for example, m1 := SELECT
     (NONE)).
  o  Mark the characters that you want in the select region by
     moving from character to character with the cursor.
  o  When all of the text is selected, create a range that contains
     the selected text (for example, r1 := SELECT_RANGE).
  o  Stop the selection of characters by setting the marker that
     marks the beginning of the range to null (m1 := 0).


 Format
    range := SELECT_RANGE

Additional information available:

Example

Example

 select_1 := SELECT_RANGE

 This assignment statement puts the range for the currently
 selected characters in the variable select_1.


 The following procedure shows the use of SELECT_RANGE
 multiple times in the same procedure.

 PROCEDURE user_select
 ! Start a select region
    user_select_position := SELECT (REVERSE);
    MESSAGE ("Selection started.");
 ! Move 5 rows and create a select region
    MOVE_VERTICAL (5);
    SR1 := SELECT_RANGE;
 ! Move 5 rows and create another select region
    MOVE_VERTICAL (5);
    SR2 := SELECT_RANGE;
 ! Stop the selection by setting the select marker to 0.
    user_select_position := 0;
 ENDPROCEDURE

SEND

 Passes data to a subprocess.  If you specify a buffer or a range
 as the data to pass to a subprocess, the lines of the buffer or
 range are sent as separate records.

 Format
    SEND ({buffer|range|string}, process)

 buffer   The buffer whose contents you want to send to the subprocess.
 range    The range whose contents you want to send to the subprocess.
 string   The string you want to send to the subprocess.
 process  The process to which you want to send data.

Additional information available:

Example

Example

 SEND ('DIRECTORY', user_process)

 This command sends the DCL DIRECTORY command to the
 subprocess named user_process.  The subprocess must have
 already been created with the CREATE_PROCESS built-in so that
 the output can be stored in the buffer associated with the
 subprocess.


 The following procedure uses the SEND built-in to pass a
 command to a subprocess in which the DCL MAIL utility is
 running.  The command to be sent to the subprocess is
 obtained by using the READ_LINE built-in.

 PROCEDURE mail_subp
 ! CREATE A BUFFER AND A WINDOW THAT A SUBPROCESS CAN RUN IN
    g:= CREATE_BUFFER ("mail_buffer");
    g:= CREATE_WINDOW (1, 22, ON);
    !Map the mail window to the screen
    UNMAP (MAIN_WINDOW);
    MAP (g_mail_window, g_mail_buffer);
 ! CREATE A SUBPROCESS AND SEND "MAIL" AS THE FIRST COMMAND
    p1 := CREATE_PROCESS (g_mail_buffer, "MAIL");
 ! POSITION TO THE SUBPROCESS AND USE READ_LINE FOR NEXT COMMAND
    POSITION (g_mail_window);
    s1 := READ_LINE ("mail_subp> ", 20);
    SEND (s1, p1);
 ENDPROCEDURE

SEND_EOF

 Uses features of the VAX/VMS Mailbox Driver to send an end-of-file
 message (IO$_WRITEOF) to a subprocess.  The end-of-file causes an
 outstanding read from a subprocess to be completed with an
 SS$_ENDOFFILE status.

 Format
    SEND_EOF (process)

 process  The process to which the end-of-file is being sent.

Additional information available:

Example

Example

 SEND_EOF (sub_proc1)

 This command sends an end-of-file to sub_proc1.

SET

 Allows you to establish or change certain features of a VAXTPU
 session.  SET requires a keyword as its first parameter.  The
 keyword indicates the feature being set.

 Format
    SET (keyword, parameter [,...])

 keyword    Indicates which feature is being set. The list
            of valid keywords follows:


 For a Buffer
 -----------
 EOB_TEXT     FORWARD        INSERT        MARGINS       MAX_LINES
 NO_WRITE     OUTPUT_FILE    OVERSTRIKE    PERMANENT     REVERSE
 SYSTEM       TAB_STOPS


 For a Window
 ------------
 PAD    SCROLLING   STATUS_LINE    TEXT    VIDEO    WIDTH


 For the screen
 ---------------------
 AUTO_REPEAT     PROMPT_AREA      SCREEN_UPDATE


 For the system
 --------------
 BELL            FACILITY_NAME    INFORMATIONAL    JOURNALING
 KEY_MAP_LIST    MESSAGE_FLAGS    SELF_INSERT      SHIFT_KEY
 SUCCESS         TIMER            UNDEFINED_KEY

 Misc
 ----
 DEBUG


 parameter   The number of and type of parameters following the first
             parameter varies according to the keyword you use. The
             parameters are listed in the individual SET descriptions.

Additional information available:

AUTO_REPEATBELLDEBUGEOB_TEXTFACILITY_NAME
FORWARDINFORMATIONALINSERTJOURNALINGKEY_MAP_LIST
MARGINSMAX_LINESMESSAGE_FLAGSNO_WRITEOUTPUT_FILE
OVERSTRIKEPADPERMANENTPROMPT_AREA
REVERSESCREEN_UPDATESCROLLINGSELF_INSERTSHIFT_KEY
STATUS_LINESUCCESSSYSTEMTAB_STOPSTEXT
TIMERUNDEFINED_KEYVIDEOWIDTH

AUTO_REPEAT

 Refers to the repetition of keystrokes when you hold down a key.
 VAXTPU sends an escape sequence to the terminal to set AUTO_REPEAT
 on or off.

 Format
      SET (AUTO_REPEAT, keyword)

 AUTOREPEAT  This keyword refers to the repetition of keystokes.
 keyword     Indicates whether this feature is turned on. The valid
             keywords are ON and OFF.

 EXAMPLE

 SET (AUTO_REPEAT, OFF)

 This statement turns AUTO_REPEAT off.

BELL

 VAXTPU turns the terminal bell off by default.  If you want the
 bell to ring when you receive broadcast messages such as those
 from the MAIL utility, use this built-in to turn the bell on.

 Format
      SET (BELL, keyword1, keyword2)

 BELL      This keyword refers to the terminal bell.
 keyword1  Indicates which messages keyword2 applies to. The valid
           keywords are ALL or BROADCAST.
 keyword2  Indicates whether the terminal bell is on. The valid
           keywords are ON an OFF.

 EXAMPLE

 SET (BELL, BROADCAST, ON)

 This statement causes the terminal bell to ring when a broadcast
 message is being written to the message window.

DEBUG

 Allows you to use a user-written debugger program to help locate
 programming errors.

 Format
    SET (DEBUG, keyword1, [,{string|ALL}])

 DEBUG    This keyword refers to a program that helps you locate
          VAXTPU programming errors.

 keyword1 The valid keywords are ON, OFF, and PROGRAM:
          ON---Causes a debugger to do single-step debugging. Each
               time the line number in a VAXTPU program changes, the
               debugger is invoked.
          OFF---Disables single_step debugging.
          PROGRAM---Indicates that the user has written a program that
                    will be used to locate TPU programming errors.

 string   Either the name of a procedure or the name of a program.
          If the name of a procedure follows the keyword ON, the
          debugger is invoked each time the procedure is called.
          If the name of a procedure follows the keyword OFF, the
          debugger removes the breakpoint that was set at the procedure.
          If a program follows the keyword PROGRAM, the
          program will be used as a user-written debugger.

 ALL      The keyword ALL can be specified if keyword1 is OFF. The
          statement SET (DEBUG, OFF, ALL) causes all breakpoints to be
          removed.

 EXAMPLE

 SET (DEBUG, ON, "user_remove")

 This statement causes the debugger to be activated each time the
 procedure user_remove is called.


 SET (DEBUG, PROGRAM, "user_debugger")

 This statement causes the user-written program user_debugger to be
 called as the program to help locate programming errors.

EOB_TEXT

 Allows you to specify the text that is displayed to indicate the
 end of a buffer.

 Format
      SET (EOB_TEXT, buffer, string)

 EOB_TEXT    This keyword refers to the text displayed at the
             end of a buffer.
 buffer      The buffer in which the text for the end-of-buffer
             is being set.
 string      The text that will be displayed to indicate the
             end-of-buffer.

 EXAMPLE

 SET (EOB_TEXT, main_buffer, "[END OF MAIN EDITING BUFFER]")

 This statement causes [END OF MAIN EDITING BUFFER] to be displayed
 as the end-of-buffer text for main_buffer.

FACILITY_NAME

 Allows you to control the facility name that is the first item in
 a message.  The maximum length of this name is 10 characters.

 Format
      SET (FACILITY_NAME, string)

 FACILITY_NAME  This keyword refers to the facility name that is
                the first item in a message generated by VAXTPU.
 string         The string that you specify as the facility name for
                messages. The maximum length of this name is 10
                characters.

 EXAMPLE

 SET (FACILITY_NAME, "new_editor")

 This statement causes new_editor to be used as the facility name
 in messages.

FORWARD

 Allows you to set the direction of the buffer in a forward
 direction.  See SET (REVERSE,...).

 Format
      SET (FORWARD, buffer)

 FORWARD    FORWARD means to go toward the end of the buffer.
 buffer     The buffer in which you are setting the direction.

 EXAMPLE

 SET (FORWARD, my_buffer)

 This statement causes the direction of the buffer to be toward the
 end of the buffer.

INFORMATIONAL

 Allows you to turn informational messages on or off.  When you are
 developing VAXTPU programs, the informational messages help you
 find errors in your program, so it is a good idea to use the SET
 (INFORMATIONAL, ...) built-in to cause the messages to be
 displayed.

 Format
      SET (INFORMATIONAL, keyword)

 INFORMATIONAL   Informational level messages
 keyword         The valid keywords are ON an OFF.

 EXAMPLE

 SET (INFORMATIONAL, ON)

 This statement causes the display of informational messages to be
 turned on.

INSERT

 Allows you to set the mode for text entry so that characters are
 added to the buffer in front of the current character position.
 See SET (OVERSTRIKE,...).

 Format
      SET (INSERT, buffer)

 INSET   A mode of text entry in which characters are inserted in
         front of the current character position.
 buffer  The buffer in which you are setting the mode of text entry.

 EXAMPLE

 SET (INSERT, my_buffer)

 This statement causes the characters that you add to the buffer to
 be added in front of the current character position.

JOURNALING

 Allows you to determine the frequency with which records are
 written to the journal file; the lower the integer you specify,
 the more often journal records are written to disk.

 A value of 1 causes a record to be written for approximately every
 10 keys pressed.  A value of 10 causes a record to be written for
 approximately every 125 keys.  If you are entering only text
 (rather than procedures that are bound to keys), the number of
 keystrokes included in a record is greater:  for a value of 1, a
 record will be written for approximately every 30 to 35
 keystrokes; for a value of 10, a record will be written for
 approximately every 400 keystrokes.

 Format
    SET (JOURNALING, integer)

 JOURNALING   This keyword refers to the journal file that enables
              you to recover your editing session if it is interrupted
              abnormally.
 integer      The integer that you specify determines how frequently
              records are written to the journal file. The value of
              this integer must be between 1 and 10.

 EXAMPLE

 SET (JOURNALING, 1)

 This statement causes records to be written to the journal file
 frequently.

KEY_MAP_LIST

 Binds a specified key-map list to a buffer.  If the buffer is not
 specified, the default is to bind the key-map list to the current
 buffer in use.  A key-map list can be associated with only one
 buffer at a time.

 Format
    SET (KEY_MAP_LIST, string [,buffer])

 KEY_MAP_LIST  Keyword that refers to the key-map list that you
               bind to a buffer.

 string        A quoted string, or a variable name representing
               a string constant, that specifies the key-map list
               that you bind to a buffer.

 buffer        Buffer to which you bind the specified key-map list.
               The default is the current buffer to which you are
               positioned.


 EXAMPLE

 SET (KEY_MAP_LIST, "tpu$_key_map_list")

 This statement binds the key-map list called tpu$_key_map_list to
 the current buffer.

MARGINS

 The margins for a buffer are set to 1 for the left margin and 80
 for the right margin when CREATE_BUFFER is used.  This built-in
 allows you to change the margin settings for a buffer.  The value
 of the left margin must be at least 1, and less than or equal to
 the right margin value.  The value of the right margin must be
 less than the maximum record size for the buffer.  You can use x
 := GET_INFO (buffer, "record_size") to obtain the maximum record
 size of a buffer.

 The FILL built-in uses the margin settings when it is filling the
 text of a buffer.

 Format
    SET (MARGINS, buffer, integer1, integer2)

 MARGINS    This keyword refers to the left and right margins of a
            buffer.
 buffer     The buffer in which the margins are being set.
 integer1   The column at which the left margin is set.
 integer2   The column at which the right margin is set.

 EXAMPLES

 SET (MARGINS, my_buffer, 1, 132)

 This statement changes the left margin of my_buffer to 1 and the
 right margin to 132.


 SET (MARGINS, CURRENT_BUFFER, 10, 70)

 This statement causes the margins of the current buffer to be
 changed to left margin 10 and right margin 70.

MAX_LINES

 Allows you to set the maximum number of lines in a buffer.  If you
 exceed the maximum number of lines, VAXTPU deletes lines from the
 beginning of the buffer to make room for any lines that exceed the
 maximum.

 If you use 0 as the number of lines for the buffer, this feature
 is turned off and VAXTPU does not check for the maximum number of
 lines.

 Format
    SET (MAX_LINES, buffer, integer)

 MAX_LINES     This keyword refers to the maximum number of lines a
               buffer can contain.
 buffer        The buffer for which you are setting the maximum number
               of lines.
 integer       The maximum number of lines for the buffer.

 EXAMPLE

 SET (MAX_LINES, message_buffer, 20)

 This statement causes the maximum number of lines for the
 message_buffer to be 20.  Only the most recent lines of messages
 will be kept.

MESSAGE_FLAGS

 Allows you to specify how much of a message will be displayed.  If
 you do not set a value for the message flags from within VAXTPU,
 the default message flags for your process are used.  Setting the
 message flags to 0 does not turn off the message text.  It causes
 VAXTPU to use the default message flags for your process.  In
 addition to setting the message flags from within VAXTPU, you can
 set them at the DCL level with the command SET MESSAGE.  This is
 the only way you can turn off all message text.  See the VAX/VMS
 DCL Dictionary for information on the DCL command.

 Format
      SET (MESSAGE_FLAGS, integer)

 MESSAGE_FLAGS     This keyword refers to the message flags in the
                   $PUTMSG System Service.
 integer           The value specified for the $PUTMSG Message Codes.

 EXAMPLES

 SET (MESSAGE_FLAGS, 2)

 This statement causes the message identifier to be the only item
 included in VAXTPU messages.  The integer 2 sets bit 1.


 SET (MESSAGE_FLAGS, 5)

 This statement causes the message text (bit 0 = 1) and the
 severity level indicator (bit 2 = 4) to be included in VAXTPU
 messages.  The integer 5 sets bits 2 and 0.

NO_WRITE

 Allows you to specify that no output file should be created from
 the contents of a buffer upon exiting from VAXTPU.

 Format
      SET (NO_WRITE, buffer, [keyword])

 NO_WRITE   This keyword specifies that no output file should be
            created from the contents of a buffer upon exiting from
            VAXTPU even if the contents of the buffer have been
            modified.
 buffer     The buffer whose contents you do not want written out when
            you exit from VAXTPU.
 keyword    Allow you to turn the setting on or off. The keywords ON and
            OFF are optional; if you don't use this keyword, the default
            is ON.


 EXAMPLE

 SET (NO_WRITE, my_buffer)

 This statement causes my_buffer not to be saved in a file upon
 exiting from VAXTPU.


 SET (NO_WRITE, my_buffer, OFF)

 This statement changes the state of my_buffer from no-write.  The
 contents of the buffer will be written out upon exiting from
 VAXTPU if the buffer has been modified.

OUTPUT_FILE

 Allows you to specify the name of the file that is to be created
 from the contents of a buffer.  If you do not modify the buffer
 for which you have specified an output file, that file will not be
 written out upon exiting from VAXTPU.

 The SET (OUTPUT_FILE, ...) built-in will work only if you did not
 set the NO_WRITE attribute for the buffer.

 Format
      SET (OUTPUT_FILE, buffer, string)

 OUTPUT_FILE    This keyword refers to the file specification that
                is to be created from the contents of a buffer when
                you exit from VAXTPU.
 buffer         The buffer whose contents will be written to the file
                you specify.
 string         The file specification for the file being written out.

 EXAMPLE

 SET (OUTPUT_FILE, paste_buffer, 'newfile.txt')

 This statement causes the output file for paste_buffer to be
 newfile.txt.

OVERSTRIKE

 Allows you to set the mode for text entry so that the characters
 you add to a buffer will replace characters in the buffer,
 starting at the current character position and continuing for the
 length of the text that you enter.  See SET (INSERT,...).

 Format
      SET (OVERSTRIKE, buffer)

 OVERSTRIKE   This keyword means that the characters that you add
              to a buffer will replace the characters starting at
              the current character position and continuing for the
              length of the text that you enter.
 buffer       The buffer whose mode of text entry you want to set.

 EXAMPLE

 SET (OVERSTRIKE, my_buffer)

 This statement sets the mode for text entry in my_buffer to be
 overstrike.

PAD

 Allows you to fill in screen lines with blanks rather than ending
 a line at the end of a record.  When video attributes are applied
 to a padded window, the window has an even or "boxed" appearance
 on the right side.  The records in the buffer are not padded, only
 the display lines have the padding.

 By default, VAXTPU ends a line on the screen at the end of a
 record.  The default behavior of not padding the screen gives
 maximum editing performance.



 Format
    SET (PAD, window, keyword)

 PAD      This keyword refers to padding screen lines with blanks rather
          than ending a line at the end of a record.
 window   The window in which lines are padded.
 keyword  Indicates whether this feature is on or off.
          ON---Causes VAXTPU to display blanks after the last character
               of a record.
          OFF---Causes the display of lines on the screen to stop at
                the last character of a record.

 EXAMPLE

 SET (PAD, second_window, ON);
 SET (VIDEO, second_window, REVERSE);

 The first statement causes second_window to be blank padded.  The
 second statement causes second_window to be displayed in reverse
 video.  The window will have an even right margin.

PERMANENT

 Allows you to set a buffer so that it cannot be deleted.  Once you
 use SET (PERMANENT, buffer) to make a buffer permanent, you cannot
 reset the buffer so that it can be deleted.

 Format
      SET (PERMANENT, buffer)

 PERMANENT    This keyword specifies that a buffer cannot be deleted.
 buffer       The buffer that is not to be deleted.



 EXAMPLE

 SET (PERMANENT, master_buffer)

 This statement causes master_buffer to be set to a permanent
 buffer.

PROMPT_AREA

 Allows you to set the area on the screen in which the prompts
 generated by the READ_LINE built-in are displayed.

 If the prompt area overlaps a line of a window that is visible on
 the screen, the line is erased when the READ_LINE built-in is
 executed.  When the execution of READ_LINE is completed, the line
 is restored.

 If you have a multiple line prompt area and your terminal has
 hardware scrolling capabilities, the first prompt appears on the
 last line of the prompt area and as new, continguous prompts are
 issued, the previous prompts scroll up to make room for new ones.
 If there are more prompts than there are prompt lines, extra
 prompts are scrolled out of the window.

 If your terminal doesn't have hardware scrolling capabilities,
 prompts are displayed starting at the first line down and start
 over at the first prompt line if the prompt area is filled.

 Format
    SET (PROMPT_AREA, integer1, integer2, keyword)

 PROMPT_AREA  This keyword refers to an area on the screen in which the
              prompts generated by the READ_LINE built-in are displayed.
 integer1     The screen line number at which the PROMPT_AREA starts.
 integer2     The number of screen lines in the PROMPT_AREA.
 keyword      You must use one of the following keywords
              NONE, BOLD, BLINK, REVERSE, or UNDERLINE.

 EXAMPLE

 SET (PROMPT_AREA, 24, 1, REVERSE)

 This statement causes the prompt area to be screen line number 24.
 It is one line and is displayed in reverse video.

REVERSE

 Allows you to set the direction of the buffer in a reverse
 direction.  See SET (FORWARD,...).

 Format
      SET (REVERSE, buffer)

 REVERSE     The keyword means that the direction of the buffer is
             toward the beginning of the buffer.
 buffer      The buffer whose direction you are setting.

 EXAMPLE

 SET (REVERSE, my_buffer)

 This statement causes the direction of the buffer to be toward the
 beginning of the buffer.

SCREEN_UPDATE

 Allows you to control when the screen manager sends characters and
 cursor movement sequences to update the screen.

 Format
    SET (SCREEN_UPDATE, keyword)

 SCREEN_UPDATE   This keyword refers to the process of sending
                 characters and cursor movement sequences to the
                 screen to ensure that the screen reflects the
                 current internal state of any buffer displayed on
                 the screen. The VAXTPU screen manager handles this
                 function.

 keyword         The valid keywords are ON and OFF:
                 ON---Causes the screen manager to send characters and
                      cursor movement sequences to update the screen.
                 OFF---Causes the screen manager to stop screen updating
                       until SET (SCREEN_UPDATE, ON) is issued.


 EXAMPLE

 SET (SCREEN_UPDATE, OFF)

 This statement causes screen updating to be turned off.  When you
 are designing an editing interface, you might want to use this
 statement to prevent some intermediate processing steps from
 appearing on the screen.

SCROLLING

 Allows you to control the movement of lines in a window to make
 room for new lines at the top or bottom of the window.

 This built-in is used to modify the scrolling action of a window.
 The default values are SET (SCROLLING, window, ON, 0, 0, 0,).

 Format
    SET (SCROLLING, window, keyword, integer1, integer2, integer3)

 SCROLLING  This keyword refers to the upward or downward movement of
            existing lines in a window to make room for new lines at
            the bottom or top of the window. When a window is scrolled,
            the cursor position remains in the same column, but the
            screen line that the cursor is on may change.

 window     The window in which the scrolling limits are being set.

 keyword    The valid keywords are ON or OFF:
            ON---Causes scrolling to be turned on.
            OFF---Causes scrolling to be turned off. The screen will be
                  repainted each time a scroll would have taken place.

 integer1   The offset from the top screen line of a window. The offset
            identifies the top limit of an area in which the cursor can
            move as it tracks the current character position.

 integer2   The offset from the bottom screen line of a window. The
            offset identifies the bottom limit of an area in which the
            cursor can move as it tracks the current character
            position.

 integer3   The number indicating how many lines from the top or the
            bottom of the cursor area the cursor should be positioned
            when a window is scrolled. The cursor area is delimited by
            integer1 and integer2.

 EXAMPLES

 SET (SCROLLING, new_window, ON, 0, 0, 2)

 This statement causes new_window to scroll in the following
 manner:  when the cursor reaches either the top or the bottom of
 the window, lines will be moved off the screen to make room for
 new lines.  The cursor will be positioned on a line that is offset
 2 lines from either the top or the bottom of the window each time
 a scroll occurs.


 SET (SCROLLING, new_window, ON, 0, 0, 20)

 If new_window is 21 lines long, this command causes new_window to
 scroll in the following manner:  when the cursor reaches either
 the top or the bottom of the window, lines will be moved off the
 screen to make room for new lines.  The cursor will be positioned
 at the top of the window if you are scrolling forward and at the
 bottom of the window if you are scrolling backward.  This setting
 for scrolling presents an entire window of new text each time a
 scroll occurs.

SELF_INSERT

 PF1 is VAXTPU's shift key by default.  If you want to use PF1 for
 another purpose, use this built-in to define a key other than PF1
 as VAXTPU's shift key.  Using a shift key for VAXTPU increases the
 number of keys and combinations of keys that can be used to bind
 procedures.  Only one VAXTPU shift key can be active at a time.

 Format
      SET (SELF_INSERT, string, keyword)

 SELF_INSERT  Keyword that specifies whether printable
              characters are inserted when entered if
              no procedures are bound to them.

 string       A quoted string, or a variable name
              representing a string constant, that
              specifies the key-map list that is active.

 keyword      The valid keywords are ON and OFF:
              ON---Causes the printable characters to be
                   inserted when no procedures are bound
                   to them, while the specified key-map
                   list is active.
              OFF--Causes the UNDEFINED_KEY procedure to
                   be called when these characters are
                   entered.

 EXAMPLE

 PROCEDURE toggle_self_insert

      LOCAL current_key_map_list;

      current_key_map_list := GET_INFO (CURRENT_BUFFER, "key_map_list");

      IF GET_INFO (current_key_map_list, "self_insert")
      THEN
           SET (SELF_INSERT, current_key_map_list, OFF)
      ELSE
           SET (SELF_INSERT, current_key_map_list, ON)
      ENDIF;

 ENDPROCEDURE;

 This procedure toggles the ON and OFF setting of SELF_INSERT for
 the key-map list bound to the current buffer.

SHIFT_KEY

 PF1 is VAXTPU's shift key by default.  If you want to use PF1 for
 another purpose, use this built-in to define a key other than PF1
 as VAXTPU's shift key.  Using a shift key for VAXTPU increases the
 number of keys and combinations of keys that can be used to bind
 procedures.  Only one VAXTPU shift key can be active at a time.

 Format
      SET (SHIFT_KEY, keyword [, string])

 SHIFT_KEY    This keyword refers to VAXTPU's shift key
              (by default PF1).

 keyword      A VAXTPU keyname for a key.

 string       A quoted string, or a variable name representing
              a string constant, that is a key-map list name.
              This optional argument specifies the key-map list
              in which the shift key is used.  If the key-map
              list is not specified, the key-map list associated
              with the current buffer is used.


 EXAMPLE

 SET (SHIFT_KEY, PF4, "tpu$key_map_list")

 This statement causes the keypad key PF4 to be defined as the
 shift key for the editor.  This definition holds true in the
 default key-map list called tpu$key_map_list.

STATUS_LINE

 Allows you to control the display of a status line that was
 established with the CREATE_WINDOW built-in.  By default, a status
 line is displayed in reverse video, it contains the name of the
 buffer associated with the window and the name of the file
 associated with the buffer, if there is one.

 Format
      SET (STATUS_LINE, window, keyword, string)

 STATUS_LINE     The last line in a window. You can use this line to
                 display text or to display status information about
                 the window.
 window          The window in which the status line is being modified.
 keyword         Specifies the video attribute for the STATUS_LINE. You
                 must use one of the following keywords:  NONE, BOLD,
                 BLINK, REVERSE, UNDERLINE, or SPECIAL_GRAPHICS.
 string          The text to be displayed on the STATUS_LINE. To remove
                 a status line, use a null string ("") as this
                 parameter.

 EXAMPLES

 SET (STATUS_LINE, my_window, REVERSE, "MAIN BUFFER - newfile.txt")

 This statement causes the status line in my_window to be displayed
 in reverse video with the buffer specified as MAIN BUFFER and the
 file specified as newfile.txt.


 SET (STATUS_LINE, my_window, NONE, "")

 Causes the status line in my_window to be removed by setting the
 final parameter to a null string.

SUCCESS

 Allows you to turn success messages on or off.

 Format
      SET (SUCCESS, keyword)

 SUCCESS         Success level messages.
 keyword         The valid keywords are ON an OFF.

 EXAMPLE

 SET (SUCCESS, OFF)

 This statement turns off the display of success messages.

SYSTEM

 Allows you to identify a buffer as a system buffer as opposed to a
 user buffer.  Programmers who are building an editing interface
 can distinguish their system buffers from buffers that the user
 creates.  Once you make a buffer a system buffer, you cannot reset
 the buffer.

 Format
      SET (SYSTEM, buffer)

 SYSTEM    This keyword specifies that a buffer is used by the system
           and that it is not for use by the user of the system.
 buffer    The buffer that is being set to a system buffer.

 EXAMPLE

 SET (SYSTEM, message_buffer)

 This statement causes message_buffer to be set as a system buffer.

TAB_STOPS

 Allows you to set tab stops in one of two ways.  If you use a
 string ("3 6 9"), VAXTPU uses these numbers as the actual tab stop
 values.  If you use an integer (4), VAXTPU uses the integer as an
 interval between tab stops.

 Format
      SET (TAB_STOPS, buffer, {string|integer})

 TAB_STOPS   This keyword refers to the tab stops in a buffer.
 buffer      The buffer in which the tab stops are being set.
 string      A string of numbers (each separated from the next by
             a space), which will be considered actual tab stop
             settings. The minimum value for a tab stop setting
             is 1 and the maximum value is 65535. The maximum
             number of tab stops that you can include in the string
             is 100. You must list the tab stops in ascending order
             ("3 6 9 12").
 integer     The integer that you enter is considered an interval
             between tab stops rather than an actual tab stop
             setting. If you enter the integer 4, tab stops occur
             every 4 columns. The minimum value for the integer is
             1 and the maximum value is 65535.

 EXAMPLE

 SET (TAB_STOPS, CURRENT_BUFFER, 4)

 This statement causes the tab stops in the current_buffer to be
 set at intervals of 4.  SET (TAB_STOPS, CURRENT_BUFFER, "4 8 10
 18")

 This statement causes the tab stops in the current buffer to be
 set at columns 4, 8, 10, and 18.

TEXT

 Allows you to specify how the text in a window should be
 displayed.  BLANK_TABS displays tabs as blank spaces.
 GRAPHIC_TABS displays tabs as special graphic characters so that
 each tab stop is obvious.  NO_TRANSLATE causes every character
 that is read from the keyboard to be sent to the screen without
 any translation.  The default is BLANK_TABS.

 Format
    SET (TEXT, window, keyword)

 TEXT     This keyword refers to the way in which text will be
          displayed.
 window   The window in which the mode of display is being set.
 keyword  The valid keywords are
          BLANK_TABS-----Displays tabs as blank spaces.
          GRAPHIC_TABS---Displays tabs as special graphic characters
                         so that the value of each tab stop is obvious.
          NO_TRANSLATE---Causes every character that is read from the
                         keyboard to be sent directly to the screen
                         without any translation. Use this keyword with
                         caution since it may cause unpredictable
                         results if you do not fully understand the
                         translations that are done by default.

 EXAMPLE

 SET (TEXT, CURRENT_WINDOW, GRAPHIC_TABS)

 This statement causes the text in main_window to be displayed with
 special characters indicating tab characters.

TIMER

 Allows you to specify a message that is written to the prompt area
 at one-second intervals.  The timer puts out messages while you
 are executing procedures or editing actions that are bound to a
 key.  The message is written out to the prompt area and then
 erased to clear the prompt area for the next message.

 Format
      SET (TIMER, keyword [, string])

 TIMER    This keyword refers to messages that are to be written to
          the prompt area at one-second intervals.
 keyword  The valid keywords are
          ON---Causes the message that you specify to be written to
               the prompt area.
          OFF--Turns off the display of timed messages in the prompt
               area.
 string   A quoted string, a variable name representing a string
          constant, or an expression that evaluates to a string,
          that is displayed in the prompt area. The maximum length
          of the message is 15 characters. The message is displayed
          in the last 15 character positions of the prompt area. If
          ON is specified and a string was never specified for the
          last argument, the timer puts out the message "working".
          If ON is specified and a string was specified previously,
          the string is saved and is used as the default.


 EXAMPLE

 SET (TIMER, ON, "Executing")

 This statement causes the message "Executing" to be written to the
 prompt area while you are executing a VAXTPU procedure.

UNDEFINED_KEY

 Allows you to set the procedure for an undefined key.  The default
 procedure for an undefined key is to display the message, "key has
 no definition".  If the third parameter is not given, the action
 on an undefined key is to reset it to the default.

 Format
      SET (UNDEFINED_KEY, string1
           [,string2|,buffer|,range|,program|,learn])

 UNDEFINED_KEY    This keyword refers to the action taken
                  when an undefined key-map key is input.

 string1          A quoted string, or a variable name
                  representing a string constant, that
                  specifies the key-map list for which
                  this procedure is called.

 third parameter  This optional parameter specifies the
                  action on an undefined key. If the
                  parameter is a string, buffer, or range,
                  it is compiled.

 EXAMPLE

      IF GET_INFO ("tpu$key_map_list", "undefined_key") <> 0
      THEN
           SET (UNDEFINED_KEY, "tpu$key_map_list");
      ENDIF;

 This code causes the default undefined key message to be displayed
 when an undefined key is entered.

VIDEO

 Allows you to set the video attributes for a window.  The default
 video attribute for windows is NONE.  Video attributes for a
 window are cumulative.  The window will assume the video attribute
 of each video keyword that you use with SET (VIDEO, ...) during an
 editing session.  If you want to change the video attribute of a
 window and you do not want the cumulative effect of previous
 attributes, use SET (VIDEO, window, NONE) before specifying the
 new attribute.

 Format
      SET (VIDEO, window, keyword)

 VIDEO      This keyword refers to the video attributes of a window.
 window     The window in which a video attribute is being set.
 keyword    You must use one of the following keywords:
            NONE, BOLD, BLINK, REVERSE, or UNDERLINE.

 EXAMPLE

 SET (VIDEO, CURRENT_WINDOW, REVERSE);
 SET (VIDEO, CURRENT_WINDOW, UNDERLINE);

 These statements cause the current window to be displayed in
 reverse video and with underlining.

WIDTH

 Allows you to specify the width of a window.  If a SET (WIDTH,
 ...) command causes a window to become wider than the screen,
 VAXTPU will change the screen width to 132 columns.  If the screen
 width is 132 columns and a SET (WIDTH, ...) command causes a
 window to be less than 81 columns, VAXTPU will change the screen
 size to 80 if all of the other windows are also less than 81
 columns wide.

 Format
    SET (WIDTH, window, integer)

 WIDTH    This keyword refers to the width of a window.
 window   The window in which the width is being set.
 integer  The value that specifies the width of the window.

 EXAMPLE

 SET (WIDTH, CURRENT_WINDOW, 132)

 This statement causes the current_window to be 132 columns wide.

SHIFT

 Changes the relative position of text that is displayed in a
 window on the screen.  The character position that is displayed in
 column 1 on the screen will be shifted to the right or to the
 left.  The shift applies to any buffer associated with the window
 that you specify.  SHIFT optionally returns an integer.

 Format
      [integer2 :=] SHIFT (window, integer1)

 window    The window in which the shift in the position of the text
           will take place.
 integer1  The signed (+/-) integer that specifies how many columns to
           shift the text. A positive integer causes the text to shift
           from the right to the left so that you can see text beyond
           the right edge of the window.

           A negative integer causes the text to shift from the left to
           the right so that you can see text beyond the left edge of
           the window. If the first character in the line of text is
           already in column 1, then using a negative integer to shift
           to the right will have no effect.

           If you specify 0 as the value, no shift takes place.

Additional information available:

Examples

Examples

 SHIFT (user_window, +5)

 This statement causes the text displayed in user_window to be
 shifted 5 columns to the left.

 SHIFT (CURRENT_WINDOW, -5)

 This statement causes the text displayed in the current_window to
 be shifted 5 columns to the right as long as text exists beyond
 the left margin.

SHOW

 Displays information about keyword, data types, and the current
 settings of attributes that can be applied to certain data types.

 Format
      SHOW ({keyword|data type})

 keyword    The following are valid keywords:

            BUFFER[S]--Displays information about all buffers
                       available to the editor.
            KEY_MAP_LIST[S]-Displays the names of all defined
                       key-map lists, their key maps, and the
                       number of keys defined in each key map.
            KEY_MAP[S]-Displays the names of all defined key maps.
            KEYWORDS---Displays all items in the internal keyword table.
            PROCEDURES-Displays the names of all defined procedures.
            SCREEN-----Displays information about the terminal.
            SUMMARY----Displays statistics about VAXTPU including the
                       current version number.
            VARIABLES--Displays the names of all defined variables.
            WINDOW[S]--Displays information about all windows available
                       to the editor.

 data type  Enter the variable to which a VAXTPU data type is assigned
            to get information on a particular item. You can use the
            following data types as parameters; buffer, window, and
            string.

Additional information available:

Example

Example

 SHOW (PROCEDURES)

 This statement displays on the screen a list of all the VAXTPU
 built-ins and the user-written procedures that are available to
 your editing interface.

SPAN

 Creates a pattern that will match the longest string of characters
 that contains only characters of the string specified as a
 parameter.

 Format
    pattern := SPAN (string)

 string   A string that contains the characters you want to include in
          the pattern.

Additional information available:

Example

Example

 pat1 := SPAN ('0123456789')

 This assignment statement creates a pattern that will match the
 longest sequence of digits starting at the current character
 position.






SPANL

 Returns a pattern that will match the longest string of characters
 that contains only characters specified in the string used as a
 parameter.  SPANL is similar to SPAN.  However, SPANL considers
 the end-of-line condition as a match and continues the pattern
 beyond the end-of-line.  It will continue the search for a pattern
 until it finds a character that does not appear in the string used
 as a parameter or until an end-of-search condition is found.

 SPANL must match at least one character or it fails.

 Format
    pattern := SPANL (string)

 string     A string that contains the characters you want to include in
            the pattern.

Additional information available:

Examples

Examples

 pat1 := SPANL (' ')

 This assignment statement stores a pattern in pat1 that will match
 the longest sequence of blank characters starting at the current
 character position and continuing to an end-of-search condition.


 pat2 := SPANL ('0123456789')

 This assignment statement stores in pat2 a pattern that will match
 the longest sequence of digits starting at the current character
 position and continuing to an end-of-search condition.


 pat3 := SPANL ('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

 This assignment statement stores in pat3 a pattern that will match
 the longest sequence of the alphabetic characters listed in the
 parameter.  If you use this pattern with the SEARCH built-in,
 SEARCH starts at the current character position and continues to
 an end-of-search condition.  If you specify an EXACT search, the
 characters must be uppercase for a successful match.

SPAWN

 Suspends your VAXTPU process and spawns a VMS subprocess.  After
 completing work in the subprocess, you can return to your VAXTPU
 session with the DCL ATTACH or DCL LOGOUT command.  If you use the
 DCL ATTACH command, the subprocess is available for future use.
 If you use the DCL LOGOUT command, the subprocess is deleted.
 When you return to the VAXTPU session, the screen is repainted.

 If you specify a DCL command as the parameter for SPAWN, the
 command will be executed after the subprocess is created.  When
 the command completes, the subprocess terminates, and control is
 returned to the VAXTPU process.


 Format
    SPAWN [(string)]

 string     A command that you want to send to the subprocess.

Additional information available:

Example

Example

 SPAWN ('DIRECTORY')

 This command spawns a VMS subprocess and executes the DCL
 DIRECTORY command.  When the command completes, you are returned
 to your VAXTPU session.

SPLIT_LINE

 Breaks the current line at the current character position and
 creates two lines.

 Format

      SPLIT_LINE

STR

 Converts an integer to a string.

 Format
      string := STR (integer)

 integer    The integer you want to convert to a sting.

Additional information available:

Examples

Examples

 new_numbers := STR (123)

 This assignment statement stores the string "123" in the
 variable new_numbers.


 The following procedure uses the STR built-in to convert the
 integer variable v1 to a string so that your column and row
 position can be displayed in the message area.

 PROCEDURE user_display_position
    v1 := GET_INFO (second_window, "current_column");
    MESSAGE ('Column: ' + STR (v1));
    v2 := GET_INFO (second_window, "current_row");
    MESSAGE ('Row: ' + STR (v2));
 ENDPROCEDURE

SUBSTR

 Returns a string that represents a substring of a string or a
 range.

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

 string1  The string that contains the substring.
 range    The range that contains 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.


Additional information available:

Example

Example

 file_type := SUBSTR ('login.com', 7, 3)

 This assignment statement returns the string "com" in the
 variable file_type.  The substring starts at the seventh
 character position "c" and contains 3 characters "com".  If
 you used a larger number for integer2, for example, 7, the
 variable file_type would still contain "com" and no error
 would be signaled.

TRANSLATE

 Invokes the RTL procedure STR$TRANSLATE.  This procedure takes
 three parameters.  Some of the characters in the first parameter
 will be replaced by the characters in the second parameter.  The
 third parameter is used as a match string to determine which
 characters from the first parameter will be replaced.  For more
 information on STR$TRANSLATE, see the VAX/VMS System Routines
 Volumes.

 Format
      TRANSLATE ({string1|range|buffer}, string2 , string3)

 string1   One or more of the characters in this string will be replaced
           by characters in the translate string (string2).
 range     One or more of the characters in the range will be replaced
           by characters in the translate string (string2).
 buffer    One or more of the characters in the buffer will be replaced
           by characters in the translate string (string2).
 string2   The string containing the characters that will be used to
           replace one or more characters in the first parameter.
 string3   The match string that determines how the replacement is to
           be done. The character(s) in the first parameter with the same
           index as character(s) in string3 will be replaced by string2.

Additional information available:

Example

Example

 TRANSLATE (second_buffer, 'I','i')

 This command will replace all lowercase i's in the second buffer
 with uppercase I's.

UNDEFINE_KEY

 Removes the current binding from the key that you specify.

 Format
      UNDEFINE_KEY (Keyword [,string])

 keyword   The name of a key or key combination that VAXTPU allows you
           to define. See KEYNAME_TABLE for a list of valid keynames.

 string    Specifies a key map or a key-map list in which the key is
           defined. The first definition of the key in the key maps
           that make up the key-map list is deleted. If neither a key
           map nor a key-map list is specified, the key-map list bound
           to the the current buffer is used.

Additional information available:

Example

Example

 UNDEFINE_KEY (CTRL_Z_KEY)

 This command removes the association between the key
 combination CTRL/Z and the code that it previously executed.

UNMAP

 Disassociates a window from its buffer and removes the window from
 the screen.  The window that you unmap is not deleted from the
 list of available windows.  You can cause the window to appear on
 the screen again with MAP.  The screen area of the window you
 unmap is either erased or returned to any windows that had been
 occluded by the window you have unmapped.

 If you unmap the current window, VAXTPU tries to move the cursor
 position to another window that was most recently the current
 window.  The window in which VAXTPU positions the cursor becomes
 the new current window, and the buffer that is associated with
 this window becomes the current buffer.

 Format
      UNMAP (window)

 window   The window you want to remove from the screen.

Additional information available:

Example

Example

 UNMAP (main_window)

 This command removes the main_window from the screen and
 disassociates the buffer that was mapped to the main_window
 from it.

UPDATE

 Causes the screen manager to make a window reflect the current
 internal state of the buffer that is associated with the window.

 Format
      UPDATE (window)

 window    The window you are updating. The window must be mapped to
           the screen for the update to occur.

Additional information available:

Example

Example

 UPDATE (new_window)

 This command causes the screen manager to make new_window
 reflect the current internal state of the buffer associated
 with new_window.

WRITE_FILE

 Writes data to the file that you specify.

 Format
      [string2 :=] WRITE_FILE ({buffer|range} [,string1])

 buffer  The buffer whose contents you want to write to a file.
 range   The range whose contents you want to write to a file.
 string1 The file specification to which data is written. If you do not
         specify a full file specification, VAXTPU uses the current
         device and directory. This parameter is optional. If you omit
         it, VAXTPU uses the associated output file name for the buffer.
         If there is no associated file name, VAXTPU will prompt for one.

Additional information available:

Examples

Examples

 WRITE_FILE (paste_buffer, 'myfile.txt')

 This statement writes the contents of the paste_buffer to the
 file named myfile.txt.


 my_file := WRITE_FILE (select_range, 'myfile.txt')

 This assignment statement puts the file name to which the
 select_range is written in the string my_file.

DATA_TYPES

 Data types are used to interpret the contents of a variable; the
 data type of a variable determines the operations that can be
 performed on it.  Unlike many programming languages, VAXTPU
 permits any variable to have any type of data as a value.  VAXTPU
 has no declaration statement to enforce which data type can be
 assigned to a variable.  VAXTPU variables assume a data type when
 they are placed on the left-hand side (LHS) of an assignment
 statement.  The right-hand side (RHS) of the assignment statement
 determines the data type of the variable.

 The VAXTPU data types are the following:

  o  Unspecified
  o  Integer
  o  String
  o  Buffer
  o  Window
  o  Marker
  o  Range
  o  Pattern
  o  Program
  o  Process
  o  Learn


 In addition, VAXTPU uses keywords which are internally predefined
 integers.

DEBUGGER

 The installation of VAXTPU on your system will place DEBUG.TPU
 (the debugger source file) in SYS$LIBRARY:.  The debugger is
 intended to help new users debug user-written VAXTPU procedures.
 The following instructions explain how to use the VAXTPU debugger:


 1.  Invoke VAXTPU with EDIT/TPU/COMMAND=SYS$LIBRARY:DEBUG.TPU
     [filespec].

 2.  Type in or read in the procedure(s) you want to debug.

 3.  Compile the procedure(s) (without compilation errors).

 4.  Type DEBUGON (the debugger's setup procedure) after the EDT
     Keypad Emulator's Gold KP7 command prompt or type TPU DEBUGON
     as a DO command from EVE.

 5.  Invoke the procedure that is to be debugged.

 6.  The VAXTPU debugger will prompt for a source file name (Press
     RETURN if the source is already in the current buffer).

 7.  If, while debugging the procedure, you detect an error and
     want to change the program, exit the debugger (use a G command
     or X SET(DEBUG,OFF,ALL) followed by a G command), edit your
     program, and type DEBUGON again.


 The VAXTPU debugger has 5 basic commands (all single character
 commands):

  o  s - single step to next line

  o  g - go to next breakpoint (or stop debugging if no more
     breakpoints)

  o  h - help

  o  e - examine variable followed by name of variable

  o  x - Execute followed by TPU command to execute


 (Pressing the RETURN key at the prompt will also do a single step
 command)

Additional information available:

EXAMPLES

EXAMPLES

 To debug the following procedure contained in the file TEST.TPU:

         PROCEDURE TEST
         var:='abc';
         var:=12;
         ENDPROCEDURE

 1.  Invoke TPU with the command EDIT/TPU/SECTION=EDTSECINI
     /COMMAND=SYS$LIBRARY:DEBUG test.tpu

 2.  Type Gold KP7 in the EDT interface

 3.  Type COMPILE(main_buffer) in response to the "TPU Command:"
     prompt

 4.  Type Gold KP7 in the EDT interface

 5.  Type DEBUGON in response to the "TPU Command:" prompt

 6.  Type TEST in response to the "Name of Procedure to Debug:"
     prompt

 7.  Type Gold KP7 in the EDT interface

 8.  Type TEST in response to the "TPU Command:" prompt

 9.  Type the return key in response to the "Need source (file
     spec):" prompt

10.  Type H to the debugger

11.  Type S to the debugger

12.  Type E var to the debugger

13.  Type S to the debugger

14.  Type E var to the debugger

15.  Type X MESSAGE("this is a test") to the debugger

16.  Type G to the debugger

KEYWORDS

 VAXTPU keywords are predefined integer values.  Keywords can be
 used as parameters for VAXTPU built-in procedures.  Keywords
 beginning with TPU$_ are used to report status conditions.  An
 alphabetic list of the VAXTPU keywords can be displayed on the
 screen by using the SHOW (KEYWORDS) command after the appropriate
 prompt from your editing interface.

 For a list of the keywords used to identify the keys of a terminal
 keyboard, see the HELP entry KEYNAME_TABLE.

KEYNAME_TABLE

 Keynames are VAXTPU keywords used to identify the keys of a
 terminal keyboard.  The following table shows the correspondence
 between VAXTPU keynames and the keys on the VT100 and VT200 series
 of keyboards:

   TPU KEYNAMES FOR THE EDITING AND AUXILIARY KEYPAD

 TPU Keyname             LK201           VT100-type
 -----------------------------------------------------------
 PF1                     PF1             PF1
 PF2                     PF2             PF2
 PF3                     PF3             PF3
 PF4                     PF4             PF4
 KP0,KP1,...,KP9         0,1,...,9       0,1,...,9
 PERIOD                  .               .
 COMMA                   ,               ,


 TPU Keyname (cont.)     LK201           VT100-type
 -----------------------------------------------------------
 MINUS                   -               -
 ENTER                   Enter           Enter
 UP                      Up-arrow        Up-arrow
 DOWN                    Down-arrow      Down-arrow
 LEFT                    Left-arrow      Left-arrow
 RIGHT                   Right-arrow     Right-arrow
 E1                      Find/E1
 E2                      Insert-here/E2
 E3                      Remove/E3
 E4                      Select/E4
 E5                      Prev-screen/E5
 E6                      Next-screen/E6
 HELP                    Help/F15
 DO                      Do/F16
 F6,F7,...,F20           F6,F7,...,F20


          TPU KEYNAMES FOR KEYS ON THE MAIN KEYBOARD

 TPU Keyname             LK201           VT100-type
 ---------------------------------------------------------
 TAB_KEY                 Tab             Tab
 RET_KEY                 Return          Return
 DEL_KEY                 <X]             Delete
 LF_KEY                                  Line-feed
 BS_KEY                                  Back-space
 CTRL_A_KEY              Ctrl/A *        CTRL/A *
 CTRL_B_KEY              Ctrl/B          CTRL/B
      .                    .               .
      .                    .               .
      .                    .               .
 CTRL_Z_KEY              Ctrl/Z          CTRL/Z

    * CTRL/A refers to the "A" key being pressed together with
      the CTRL key. "A" and "a" produce the same results.

SYNTAX

 The syntax rules for writing VAXTPU programs are very simple.  You
 must separate each executable statement from other statements with
 a semicolon.  In a program, you must position all procedure
 definitions before any executable statements that are not part of
 a procedure definition.  The following example shows the correct
 syntax for a VAXTPU program:

  PROCEDURE...ENDPROCEDURE
            .
            .
            .
  statement-1;
            .
            .
            .


 Following is a variety of syntactically correct VAXTPU programs:

 !Program 1
 !This program consists of a single VAXTPU built-in procedure.

    SHOW (KEYWORDS)


 !Program 2
 !This program consists of an assignment statement that
 !gives a value to the variable edt$x_video.

    edt$x_video

 !Program 3
 !This program consists of a series of VAXTPU statements,
 !including the LOOP statement (with a condition for exiting)
 !and the VAXTPU built-in ERASE_LINE.

   x := 0; LOOP x :=x+1; EXITIF x > 100; ERASE_LINE; ENDLOOP

 !Program 4
 !This program consists of a single procedure that causes VAXTPU
 !to accept "qui" as the command that signals a quit operation.

    PROCEDURE qui
    QUIT;         ! do VAXTPU quit operation
    ENDPROCEDURE

 !Program 5
 !This program is a collection of procedures that
 !causes VAXTPU to accept "e", "ex", or "exi" as
 !the command for a VAXTPU exit operation. The procedures
 !are followed by a statement that is a key definition.

    PROCEDURE e
    EXIT         ! do VAXTPU exit operation
    ENDPROCEDURE

    PROCEDURE ex
    EXIT
    ENDPROCEDURE

    PROCEDURE exi
    EXIT
    ENDPROCEDURE

    DEFINE_KEY ('POSITION (my_window)', CTRL_E_KEY, 'pos_wind')

 The source code files that create EVE (SYS$LIBRARY:EVESECINI.TPU)
 and the EDT Keypad Emulator (SYS$LIBRARY:EDTSECINI.TPU) are also
 good examples of correct VAXTPU syntax.

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