A.1 Line-Mode Editor; A–1 Line-Mode Editing - Compaq DEC Text Processing Utility (DECTPU) Guide Manual

Guide to the dec text processing utility
Table of Contents

Advertisement

The following DECTPU procedures are samples of how to use DECTPU to
perform certain tasks. These procedures show one way of using DECTPU; there
may be other, more efficient ways to perform the same task. Make changes to
these procedures to accommodate your style of editing.
For these procedures to compile and execute correctly, you must make sure that
there are no conflicts between these sample procedures and your interface. This
appendix contains the following types of procedures:
1. Line-mode editor
2. Translation of control characters
3. Restoring terminal width before exiting from DECTPU
4. DCL command procedure to run DECTPU from a subprocess

A.1 Line-Mode Editor

Example A–1 shows a portion of an editing interface that uses line mode rather
than screen displays for editing tasks. You can use this mode of editing for batch
jobs or for running DECTPU on terminals that do not support screen-oriented
editing.
Example A–1 Line-Mode Editing
! Portion of a line mode editor for DECTPU
!
input_file := GET_INFO (COMMAND_LINE, "file_name"); ! Set up main
main_buffer := CREATE_BUFFER ("MAIN", input_file);
POSITION (BEGINNING_OF (main_buffer));
!
LOOP
cmd := READ_LINE ("*");
IF cmd = ""
THEN
cmd_char := "N";
ELSE
cmd_char := SUBSTR (cmd, 1, 1); CHANGE_CASE (cmd_char, UPPER);
ENDIF;
CASE cmd_char FROM "I" TO "T"
Sample DECTPU Procedures
! Continuously loop until QUIT
! Only accepting I,L,N,Q,T
! buffer from input
! file
(continued on next page)
Sample DECTPU Procedures A–1
A

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dec text processing utilityDectpu

Table of Contents