\HCI=12 \FONT=ELITE \H1=TEXT:"EDX DEFINED TPU PROCEDURES" \index=(TOPIC:"EDX Defined TPU procedures") \HCI=10 \FONT=COURIER \CONTENTS=1 APPENDIX B: EDX DEFINED TPU PROCEDURES \HCI=12 \FONT=ELITE This section lists all of the TPU procedures defined by the EDX editor which are available for users to incorporate into their own TPU procedures. There are also a few useful TPU built-in procedures listed here. Some knowledge of how to write and execute programs written in TPU is required in order to make use of these procedures. For more information on the TPU programming language, consult the VAX Text Processing Utility Manual. beg_of_line Moves the cursor to the beginning of the current line. If the cursor already at the beginning of the current line, the cursor does not move. capitalize_range(range) Capitalizes the first letter of the specified range. Ignores leading punctuation. capitalize_string Capitalizes the first letter of the specified string. Ignores leading punctuation. capitalize_word Capitalizes the current word and moves the cursor to the beginning of the next word. Equivalent to the key sequence GOLD C when using the EDT keypad mode. center_line Centers the current line between the left and right margins. The left margin is column 1 by default unless changed by the line mode command SET LEFT_MARGIN. The right margin is set by the line mode command SET WRAP. If SET NOWRAP is in effect, then the edge of the screen becomes the right margin. change_windows Move between windows when in dual window mode. Equivalent to the key sequence CTRL-V when in EDT keypad mode, or the key sequence GOLD E when in WPS keypad mode. An error message occurs if not currently in dual window mode. This procedure is identical to other_window. n:=char_to_ascii(char) Returns the integer ascii value n of the specified character. copy_text(text-string) Copies the string text-string to the current buffer at the current location. This is a VAXTPU built-in procedure. For more information, see the VAX Text Processing Utility Manual. s:=current_date Returns today's date as string s. cut Cut selected range of text to paste buffer. define_key(command, key-name) Associates a valid VAXTPU command with a key or combination of keys. This is a VAXTPU built-in procedure. For more information, see the VAX Text Processing Utility Manual. PARAMETERS: command A string that specifies the VAXTPU statements to be associated with a key. Enclose the string in quotes (') or ("). key-name A VAXTPU key name for a key or combination of keys. The table of the ASCII character set in appendix C lists the VAXTPU key names for all of the keys. delete_character Deletes the current character the cursor is on. Equivalent to the 'delete character' key (keypad COMMA) on the EDT keypad. The character can later be undeleted at a new cursor position by using the undelete_character command. delete_end_of_line Deletes all characters from the cursor position to the end of the line. Equivalent to the 'delete to end of line' key (keypad 2) on the EDT keypad. The text can later be restored at a new cursor position by using the undelete_line command. delete_line Deletes all characters from the cursor position to the end of the line and appends the next line to what's left of the current line. Equivalent to the 'delete line' key (keypad PF4) on the EDT keypad. The text can later be restored at a new cursor position by using the undelete_line command. delete_previous_character Deletes the previous character. Equivalent to the DELETE key on a VT200 series keyboard. The character can later be undeleted at a new cursor position by using the undelete_character command. delete_start_of_line Deletes all characters preceding the current cursor position to the start of the line. Equivalent to CTRL-U. The text can later be restored at a new cursor position by using the undelete_line command. delete_word Deletes all characters from the current cursor position to the end of the current word. Equivalent to the 'delete word' key (keypad MINUS) on the EDT keypad. The word can later be undeleted at a new cursor position by using the undelete_word command. do_command("command-string") Executes an EDX line mode command. This procedure is very useful in an EDX initialization file. Below are some examples: do_command("SET WRAP 72"); do_command("SET SEARCH WILD"); do_command("SET CURSOR FREE"); do_command("SET TAB_KEY SPACES"); do_command("SET TAB 5, 15, 36, 50); do_command("LOCK BUFFER"); dump_commonwords Displays in a newly buffer the short ordered list of common words in the EDX dictionary database file EDX_DICTIONARY.DAT dump_dictionary Displays in a new buffer the entire list of words which make up the EDX dictionary lexical database. end_of_line Moves the cursor to the end of the current line. If the cursor is already at the end of the current line, the cursor does not move. end_of_word Moves the cursor to the end of the current word. enter_text(text-string) Copies the string text-string to the current buffer at the current location. This procedure is similar to the VAXTPU built-in procedure copy_text, except this procedure will automatically wrap to the next line when the cursor reaches the right margin. fill_paragraph Rewraps the current paragraph. The left margin is determined by the current setting of the SET LEFT_MARGIN command. By default the left margin is set to column 1. The right margin is determined by either the SET WRAP command or by the width of the screen if SET NOWRAP is in effect. goto_bottom Moves the cursor to the end of the buffer. goto_column(n) Moves the cursor to column n. If the current line is too short, spaces are inserted until the cursor reaches column n. goto_line(line-number) Go to line line-number. Counts lines starting from the beginning of the current buffer. If line-number is a null string (""), then a line number will be prompted for. goto_mark("mark-name") Moves the cursor to the named mark. If the mark is in another buffer, that buffer becomes the current buffer and is mapped to the current window. Similar to the key sequence GOLD G when using the EDT keypad mode. goto_top Moves the cursor to the beginning of the buffer. keypad_help Displays the keypad help diagram for either the EDT keypad or the WPS keypad, whichever has been selected. Press any key to erase the keypad help diagram and continue editing. lowercase_word Lowercases the current word and moves the cursor to the beginning of the next word. Equivalent to the key sequence GOLD L when using the EDT keypad mode. make_two_windows(second-buffer,file-name) Maps the current buffer to the top window and the second buffer specified to the bottom window with the cursor, unless dual windows are already being used and the cursor is currently in bottom window in which case the second buffer goes to top window with the cursor. PARAMETERS: second-buffer A string containing the name of the buffer to put in the second window. Enclose the string in quotes ("). If the buffer does not exist, one is created. If a null string "" is specified, a buffer name is prompted for. If the numeric value 0 is specified, there is no prompt and no buffer is mapped to the second window. file-name A string containing a file name. Enclose the string in quotes ("). If the buffer name specified by the second-buffer parameter does not exist, then one is created and the file name specified by this parameter is read into the newly created buffer. If a null string "" is specified, an optional file name is prompted for. If the numeric value 0 is specified, there is no prompt and no file is read into the newly created buffer. move_by_line Moves the cursor in the current direction set for the buffer to the beginning of the next or previous line. The current direction for a buffer is set by the command set(forward,current_buffer) or set(reverse,current_buffer). move_by_page Moves the cursor in the current direction set for the buffer to the next or previous form feed character. Equivalent to the 'page' key (keypad 7) on the EDT keypad. move_by_word Moves the cursor in the current direction set for the buffer to the beginning of the next or previous word. The current direction for a buffer is set by the command set(forward,current_buffer) or set(reverse,current_buffer). move_down(n) Moves the cursor down n lines. If n is a negative number the cursor moves up n lines. Equivalent to the up and down arrow keys. move_left(n) Moves the cursor left n characters. If n is negative the cursor moves right n characters. Equivalent to the left and right arrow keys. move_right(n) Moves the cursor right n characters. If n is negative the cursor moves left n characters. Equivalent to the left and right arrow keys. move_up(n) Moves the cursor up n lines. If n is a negative number the cursor moves down n lines. Equivalent to the up and down arrow keys. next_screen Scrolls the current window down one section. Equivalent to the next_screen key on a VT200 series keyboard. new_line Equivalent to the return key. Splits the current line, starts the new line at the left margin. other_window Move between windows when in dual window mode. Equivalent to the key sequence CTRL-V when in EDT keypad mode, or the key sequence GOLD E when in WPS keypad mode. An error message occurs if not currently in dual window mode. This procedure is identical to change_windows. paste Insert contents of PASTE buffer at current cursor location. previous_screen Scrolls the current window up one section. Equivalent to the prev_screen key on a VT200 series keyboard. set_mark("mark-name") Sets a mark at the current cursor position. Similar to the key sequence GOLD CTRL/G when using the EDT keypad mode. start_select Start selection of a range of text. (Same function as 'Select' key). tab Enters a tab character if SET TAB_KEY TABS is in effect, or advances the cursor to the next tab stop if SET TAB_KEY SPACES is in effect. Equivalent to the tab key. toggle_ruler_line Toggles on/off the ruler line at the top of the screen. Equivalent to the key sequence GOLD CTRL/R when in EDT keypad mode. This command is defined by the EDX editor. transpose_characters Swap current character with the next character. undelete_character Restores at the current cursor position the character most recently deleted by the delete_character; command. Equivalent to the 'undelete character' key (keypad GOLD COMMA) sequence on the EDT keypad. undelete_line Restores at the current cursor position the text most recently deleted by either the delete_line, delete_end_of_line, or delete_start_of_line, command. Equivalent to the 'undelete_line' key (keypad GOLD PF4) sequence on the EDT keypad. undelete_word Restores at the current cursor position the text most recently deleted by the delete_word command. Equivalent to the 'undelete_word' key (keypad GOLD MINUS) sequence on the EDT keypad. uppercase_word Uppercases the current word and moves the cursor to the beginning of the next word. Equivalent to the key sequence GOLD U when using the EDT keypad mode.