IBM/TI PC Directory File Editor (DF-EDIT) User Documentation Table of Contents Section 1 - DF-EDIT Overview 1.1 Introduction 1-1 1.2 Distribution Disk Contents 1-2 1.3 Production Installation 1-2 1.4 DFEDIT Parameter 1-2 1.5 Color Customization 1-3 1.6 Prompt Editing Functions 1-5 1.7 Help Utility 1-5 Section 2 - Edit File Utility 2.1 Introduction 2-1 2.2 Tool Invocation 2-1 2.3 Screen Format 2-1 2.4 Editor Functions 2-2 2.4.1 Basic Editing Functions 2-4 2.4.2 Word Functions 2-7 2.4.3 Miscellaneous Key Functions 2-8 2.4.4 Alternate Key Functions 2-9 2.4.5 Control Key Functions 2-11 2.5 Editor Commands 2-12 Section 3 - Show Directory Utility 3.1 Introduction 3-1 3.2 Tool Invocation 3-1 3.3 Screen Format 3-1 3.4 File Commands 3-2 3.5 Display Functions 3-5 3.6 Global Commands 3-7 Section 4 - Show File Utility 4.1 Introduction 4-1 4.2 Screen Format 4-1 4.3 Commands and Functions 4-1 Section 5 - Print File Utility 5.1 Introduction 5-1 5.2 Print Format 5-1 Section 6 - Text Formatter Utility 6.1 Introduction 6-1 6.2 Commands 6-1 6.3 Extra Formatting Rules 6-5 User Documentation Introduction Section 1 IBM/TI PC Directory File Editor (DF-EDIT) 1.1 Introduction This is a a set of utilities which display, edit, and print text files, and display directories. The set of utilities consist of following programs. COLORS A color configuration utility which customizes the colors for the various display areas in all the utilities. EDIT The Edit File utility is a full screen text editor which provides a powerful yet easy-to-use set of functions and commands. This utility can be invoked by the "EDIT" DOS command for a specific file or from the SHOW utility. PF The Print File utility copies a text file to the printer optionally adding page headers which give the file name, current date and time, and page number. This utility is useful for printing program source text or other unformatted text. This utility can be invoked by the "PF" DOS command for a specific file or from the SHOW utility. ROFF Since the Edit File utility is not a word processor, a simple text formatter is also provided which formats a document for printing. This formatter is modelled after FORMAT utility in "Software Tools in Pascal" by Kernighan and Plauger. SF The Show File utility displays a text file on the screen and allows the window into the file to be moved forward or backward. This utility can be invoked by the "SF" DOS command for a specific file or from the EDIT and SHOW utilities. SHOW The Show Directory utility displays all or some of the names of the files on a disk with information about the files. From this display, files can be copied, deleted, displayed, edited, printed, or renamed by simply positioning the cursor to the desired file name and using a single command character. This utility is invoked by the "SHOW" DOS command using a directory name similar to the standard "DIR" command. If you have any questions, suggestions, or problems with these utilities, send them to me or call me. Larry Kroeker Kroeker Software Products 2717 Glen Forest Ln Plano, Tx. 75023 Phone: (214)596-7946 1-1 User Documentation Introduction 1.2 Distribution Disk Contents The contents of the distribution disk are listed below. README 1ST Read first documentation INSTALL BAT Installation batch stream DFEDIT DOC Documentation file COLORS EXE Color Configuration utility EDIT EXE Edit File utility PF EXE Print File utility ROFF EXE Text Formatter utility SF EXE Show File utility SHOW EXE Show Directory utility DFEDIT HLP Help file for utilities 1.3 Product Installation The following procedure should be used to install these utilities on any and all working disks. If you have a Winchester disk, you will only have to do this procedure once. Otherwise if you only have floppy disks, you will need to follow this procedure for each working diskette. Insert the distribution disk in drive A and your working diskette in drive B. Then invoke the installation batch stream with the following command, where <drive> is the drive letter where the utilities are to be installed. A:INSTALL <drive>: This batch stream will create a "\DFEDIT" directory and copy the help files and utilities to this directory. If you do not want to use all the utilities, you may want to delete the utilities which you will not be using. Each program is self-contained and does not invoke the other programs. Then you need to use the following "PATH" directive to instruct DOS to look in the "\DFEDIT" directory for the utilities. PATH \DFEDIT This path directive should be placed in the "AUTOEXEC.BAT" file so that you do not need to set it each time you boot your machine. 1.4 DFEDIT Parameter Normally the "\DFEDIT" directory contains the help files and customization files used the utilities. You may want to copy these files to a RAM disk for faster access or move them to some other disk or directory. Therefore you can use the DOS "SET" statement to specify a value for the "DFEDIT" parameter which indicates where these files should be found. An example set command is given below and indicates the default if none is specified. SET DFEDIT=\DFEDIT This set directive should be placed in the "AUTOEXEC.BAT" file so that you do not need to set it each time you boot your machine. 1-2 User Documentation Introduction 1.5 Color Customization The colors used by the various utilities can be customized with the Colors utility. This utility is invoked by the following DOS command. COLORS The following screen is then displayed for the IBM Personal Computer. Color number, Help, Load, Quit, Save Border lines 0-Black Command lines 1-Blue Display lines 2-Green Dos screen 3-Cyan Error messages 4-Red Information lines 5-Magenta Selected block lines 6-Brown 7-Light Gray 8-Dark Gray 9-Light Blue A-Light Green B-Light Cyan C-Light Red D-Light Magenta E-Yellow F-White Select 0 to F for desired foreground color Use alt-0 to alt-7 for background color The following screen is then displayed for the TI Professional Computer. Color number, Help, Load, Normal, Quit, Reverse, Save, Underline Border lines 1-Blue Command lines 2-Red Display lines 3-Magenta Dos screen 4-Green Error messages 5-Cyan Information lines 6-Yellow Selected block lines 7-White Initially the cursor is positioned beside the "Border lines" string. The cursor then can be moved to each of the display types using the up and down cursor keys, and each color can be set by using the number of the desired color. On the IBM Personal Computer the background color can be set by using the 'alt' number keys. Each of the types of lines is described below. * "Border lines" specifies the color for display borders. This color is not used in the current set of utilities. * "Command lines" specifies the color for the top and bottom lines of each utility display. These lines display the valid commands, 1-3 User Documentation Introduction function keys and other global information. * "Display lines" specifies the color for the main text lines in each utilities display. * "Dos screen" specifies the color to be used when each utility returns to DOS. * "Error messages" specifies the color in which any error messages are displayed. * "Information lines" specifies the color used to display general information such as the directory header information in SHOW. * "Selected block lines" specifies the color of the selected block lines in the editor and the current file in the show directory utility. After each of the colors has be changed to the desired color, the colors must be saved with the 'Save' command. All the commands are described below. Help Display help information for colors utility. Load Load a color data file so that it can be modified. The default file name is "<dfedit>\COLORS.DAT" The following prompt requests the data file name. Load Colors - Enter file pathname: Normal Use normal color rather than reverse and/or underline. This option is only valid for the TI Profressional Computer. Quit Quit the color modification utility and return to DOS. Reverse Use black text on a color background. This option is only valid for the TI Profressional Computer. Save Save the color information in a data file for use by all the utilities. The default file name used by each utility is "<dfedit>\COLORS.DAT". The following prompt requests the data file name. Save Colors - Enter file pathname: Underline Use underline text color for display. This option is only valid for the TI Profressional Computer. 1-4 User Documentation Introduction 1.6 Prompt Editing Functions All of the utilities use prompts to request information from the user. These prompts are normally displayed on the top line of the screen with the prompt area underlined and the current prompt response displayed in reverse video. In the EDIT and SHOW utilities, the editor functions mappings are used. The editor function name is given in parenthesis. The section describes the functions which can be used to edit the prompt response. Abort Prompt - ESC (CmdMd) Abort the current prompt and command. Accept Current Response - RETURN (Retrn) Accept the current complete response for the prompt. Back Space One - BACKSPACE (BkSp) Delete the character to the left of the present cursor position. Beginning of Prompt - HOME (BegLn) Move to the beginning of the prompt input. Delete Character - DEL (DelCh) Delete the character at the present cursor position. Delete End-of-Line and Accept - LINE FEED (Down) Delete all the characters from the present cursor position to the end of the response and accept the resulting response. End of Prompt - END (EndLn) Move to the end of the prompt input. Move Left One - Left Arrow (Left) Move the cursor to the left one position unless it is already at the beginning of the prompt area. Move Right One - Right Arrow (Right) Move the cursor to the right one position unless it is already at the end of the current response. Toggle Insert Character Mode - INS (InsCh) Toggle the insert character mode which enables characters to be inserted rather than overtype characters in the response. 1.7 Help Utility The Help utility provides help information for the current context and utility. The following command line is displayed. Select topic with arrow keys, Index, Quit, Show, ESC-pop For most help displays, information for sub-topics is available. These sub-topics are indicated by a special character in front of the sub-topic description. To select a sub-topic, move the cursor with the up and down arrows to the desired topic and Show the information. The 1-5 User Documentation Introduction following is a description of the Help commands. Index Display the index for the help file. An index of all the topics is shown so that any help topic can be displayed. Quit Quit the Help utility and return to the calling utility. Show Show the current sub-topic. ESC-pop Return from the current topic display to the previous display. 1-6 User Documentation Edit File Utility Section 2 Edit File Utility 2.1 Introduction The edit file utility allows an ASCII text file to be modified using a full screen editor. The editor has two main modes, "edit mode" where the cursor is on the screen allowing textual changes to the file, and "command mode" where the cursor is on a command row. The editor supports editing files up to 256 columns wide. The right margin must be set to a large enough value if wide lines are to be modified. The default right margin is set at column 80 unless the tab line defines another value for the right margin. 2.2 Tool Invocation The edit file utility is invoked by the "Edit" command in the show directory utility and by the following DOS command. EDIT <file_name> If the edit file utility is invoked with the DOS command without specifing a file name, the following prompt requests the file to be edited. In this mode the edit file utility will continue to request the name of a file to be edited until an empty file name or the ESC key is used to terminate the edit file utility. Edit File - Enter pathname: When the editor is invoked, the editor enters edit mode where the text of the file can be modified. The functions supported in edit mode are described in the Editor Functions section. Finally command mode is described in the Editor Commands section. 2.3 Screen Format The screen for the editor is divided into three parts. The first part of the screen is the top row which displays the tabs and margins in edit mode and the command line in command mode. The second part of the screen is the part between the top and bottom row which displays the file being edited. This part of the screen is called the "edit window". If a non-existent file or an empty file is specified for editing, a single blank line is displayed in the window. The end of the file is indicated by a "*eof" line displayed in the edit window after the last line of the file. The last part of the screen is the bottom row which displays the function key definitions for edit mode and file information in command mode. During edit mode the top row of the screen displays a ruler line which defines the current tab settings and the left and right margins. Each tab is indicated by a "T", the left margin is indicated by a "L", and the right margin is indicated by a "R". Initially the left margin is 2-1 User Documentation Edit File Utility set at column 1, the right margin is set at column 80, and the tabs are set 8 spaces apart starting from the left margin. The tab settings and margins can be changed with the "Tabs" command described in the Editor Commands section. During command mode the top row of the screen is the command line and defines the valid commands. These commands are described in the Editor Commands section. During edit mode the bottom row of the screen defines the assignments of the numeric function keys. The IBM PC has ten function keys and the TI PC has twelve function keys. During command mode the bottom row displays information about the file being edited. The information is described below. file name Name of file being edited Current=line Current line number Total=lines Number of lines in the file Block=first/last Number of the first and last line of the selected block 2.4 Editor Functions When the editor is invoked, the cursor is placed on the text in the edit window. In this mode, the cursor can be moved in the edit window, the window can be moved over the file being edited, and the text in the window can be modified. Each of these functions is invoked by using a single key. The editor functions with their default associated key assignments are described in the following sections. The following table gives the editor function description, section in which it is described, and the short function name. 2-2 User Documentation Edit File Utility Function Section Name Adjust Line Mode 2.4.4 AdjLn Back Delete 2.4.1 BkDel Back Space 2.4.1 BkSp Back Tab 2.4.1 BkTab Back Word 2.4.2 BkWd Beginning of File 2.4.1 BegFl Bottom Row 2.4.3 BotLn Center Line 2.4.4 CenLn Command Mode 2.4.1 CmdMd Control Character 2.4.5 CtlCh Delete Character 2.4.1 DelCh Delete End of Line 2.4.1 DelEL Delete Line 2.4.1 DelLn Delete Word 2.4.2 DelWd Down One Line 2.4.1 Down Duplicate Line 2.4.4 DupLn End of File 2.4.1 EndFl Find Next 2.4.5 FndNx First Word 2.4.2 FstWd Fill Paragraph 2.4.4 Fill Help Function 2.4.4 Help Home Position 2.4.1 Home Insert Character 2.4.1 InsCh Insert Line 2.4.1 InsLn Insert Line Mode 2.4.1 InsMd Join Line 2.4.4 Join Last Word 2.4.2 LstWd Left Margin 2.4.3 BegLn Left One Character 2.4.1 Left Line Down 2.4.3 LnDwn Line Up 2.4.3 LnUp Mark Block 2.4.1 Block Next Line 2.4.1 Retrn Next Tab 2.4.1 Tab Next Word 2.4.2 NxtWd Page Down 2.4.1 PgDwn Page Up 2.4.1 PgUp Paste Text 2.4.4 Paste Replace Next 2.4.5 RepNx Right Margin 2.4.3 EndLn Right One Character 2.4.1 Right Set Tab Stop 2.4.4 SetTb Split Line 2.4.4 Split Top Row 2.4.3 TopLn Undelete Line 2.4.1 UndLn Undelete Word 2.4.2 UndWd Undo Line Changes 2.4.4 Undo Up One Line 2.4.1 Up Editor Function Key Assignements 2-3 User Documentation Edit File Utility 2.4.1 Basic Editing Functions The most common editor functions by default are assigned to the numeric function keys, the cursor keys, and other labeled function keys. The bottom row of the screen gives the current assignment of the numeric function keys. The following table gives the basic function keys and their default assigned function. Basic Editor Functions Back Space BkSp Back Space Del DelCh Delete Character Down Down Down One Line Esc CmdMd Enter Command Mode F1, PgDn PgDwn Page Down F2, PgUp PgUp Page Up F3 BegFl Beginning of File F4 EndFl End of File F5 DelLn Delete Line F6 DelEL Delete End of Line F7 UndLn Undelete Line F8 Block Mark Block F9 InsLn Insert Line F10 InsMd Insert Line Mode Home Home Home Position Ins InsCh Insert Character Left Left Left One Character Return Retrn Next Line Right Right Right One Character Tab Tab Next Tab shift Tab BkTab Back Tab Up Up Up One Line These functions are described in the following paragraphs. Back Space (BkSp) - Back Space Move the cursor left one character position but not past the left margin. If in insert character mode, the previous character is deleted. Back Tab (BkTab) - shift Tab Move the cursor backward on the present line to the previous tab stop, unless the cursor is already at the left margin. The tabs currently defined are displayed on the ruler line at the top row of the screen. If the previous tab stop is to the left of the left most column being display, the window is shifted to the left by a multiple of 10 columns in order for the cursor to remain in the window. Beginning of File (BegFl) - F3 Position the edit window so that the beginning of the file is displayed in the window, and the cursor is placed at the left margin of the first line in the file. 2-4 User Documentation Edit File Utility Delete Character (DelCh) - Del Delete the character under the cursor, and move the characters to the right of the cursor left one position. Delete End of Line (DelEL) - F6 Delete the characters on the present line from the cursor position to the right margin. These characters are placed in the line delete buffer so that the first deleted character is placed in the same column position as the first character on the present line. These characters can then be restored with the "Undelete Line" or "Paste Line" function. Delete Line (DelLn) - F5 Delete the present line and move the following lines up one row in the window. The deleted line is placed in the line delete buffer so that it can be restored with the "Undelete Line" function. If the last remaining line of the file is deleted, a single blank line will be displayed. Down One Line (Down) - Down (TI - Line Feed) Move the cursor down one row in the edit window to the next line in the file. The cursor is left in the same column position. If the present line is near the bottom row of the window, then the window is scrolled down one line. The cursor cannot be moved onto the "*eof" line on the display. End of File (EndFl) - F4 Position the edit window so that the end of the file is displayed in the window, and the cursor is placed at the left margin of the last line in the file. Enter Command Mode (CmdMd) - ESC Terminate edit mode and invoke the command mode described in the Editor Commands section. Home Position (Home) - Home Move the cursor to the left margin of the top row of the edit window. Insert Character Mode (InsCh) - Ins Change the mode so that textual characters will be inserted rather than replace the characters on the line. The inserted characters are placed before the character under the cursor and all the characters from the cursor to the end of the line are moved right one position. If a character is already at the right margin, characters cannot be inserted so a "beep" is sounded. The insert character mode is terminated by the use of any other editor function except the Back Space (BkSp) function. Insert character mode is indicated by a underline cursor rather than the normal block cursor which indicates overtype mode. Insert Line (InsLn) - F9 Insert a blank line into the file before the present line and the following lines are moved down one row. The cursor is placed on the inserted blank line at the present column position. The "Next Line" function is used to insert blank lines after the last 2-5 User Documentation Edit File Utility line of the file. Insert Line Mode (InsMd) - F10 Toggle the insert line mode for the "Next Line" function. If the insert line mode is off, the "Next Line" function simply positions the cursor on the first word of the next line. If the insert line mode is on, the "Next Line" function will insert a blank line after the present line. This is useful for adding several textual lines to the file without having to use the "Insert Line" function for each new line. Insert line mode is indicated by the small "M" for manual insert or "A" for automatic insert at the bottom right-hand corner of the edit screen. Left One Character (Left) - Left Move the cursor left one character position but not past the left margin. Mark Block (Block) - F8 (TI - F12) Use the present line as the beginning or ending line of the selected block. If a block is not selected, then the present line is a one line block. If a one line block has been selected, then the present line becomes the beginning or ending of the block. If a block is already selected, then the present line is a one line block. See the Editor Commands section for a description of the Block commands. The marked lines are normally displayed in another color or underlined. Next Line (Retrn) - Return Move the cursor to the first non-blank character on the next line of the file. If the present line is near the bottom row of the window, then the window is scrolled down one line. If "Insert Line Mode" is on, indicated by "A" on the function key row, then a blank line will be inserted after the present line, and the cursor will be placed on the blank line below the first non-blank character on the present line. If this function is used on the last line of the file, a blank line will be inserted at the end of the file. Next Tab (Tab) - Tab Move the cursor forward on the present line to the next tab stop, unless the cursor is already at the right margin. The tabs currently defined are displayed on the ruler line at the top row of the screen. If the next tab stop is to the right of the right most column being display, the window is shifted to the right by a multiple of 10 columns in order for the cursor to remain in the window. Page Down (PgDwn) - F1, PgDn Scroll the edit window down or forward by 20 lines but not past the end of the file. The cursor is normally left on the same row of the window. Page Up (PgUp) - F2, PgUp Scroll the edit window up or backward by 20 lines but not past the beginning of the file. The cursor is normally left on the same row of the window. 2-6 User Documentation Edit File Utility Right One Character (Right) - Right Move the cursor right one character position but not past the right margin. Undelete Line (UndLn) - F7 Insert the line currently in the delete line buffer into the file before the present line. The "Delete Line" and "Delete End of Line" functions place information into the delete line buffer. Several of the Block commands also use the the delete line buffer to delete, copy, or move lines. Up One Line (Up) - Up Move the cursor up one row in the edit window to the previous line in the file. The cursor is left in the same column position. If the present line is near the top row of the window, then the window is scrolled up one line. 2.4.2 Word Functions Several functions are available which operate on words rather than characters or lines. A word is any sequence of characters separated by one or more blanks. The "ctrl" left and right arrow keys are used to move forward or backward by words. The "alt" left and right arrow keys are used to move to the first and last word on a line. The "ctrl" F5 (DelLn) and F7 (UndLn) keys are used to delete and undelete words. The word operations are summarized in the following table. Editor Word Functions ctrl F3 FstWd First Word of Line ctrl F4 LstWd Last Word of Line ctrl F5 DelWd Delete Word ctrl F7 UndWd Undelete Word ctrl Left BkWd Back Word ctrl Right NxtWd Next Word These functions are described in the following paragraphs. Auto Word Wrap When typing a word near the right margin of a line, a "beep" will be sounded when the character at the right margin is entered. Then if a non-blank character is entered, the last word on the line will be wrapped to a new line inserted after the current line. If a blank character is entered, a new line is inserted after the current line and the cursor is placed at the beginning of the new line. This function does not require a special key to invoke and is valid in all modes of text entry except insert character mode. Back Word (BkWd) - ctrl Left Move the cursor backward to the end of the previous word either on the current line or on a previous line. 2-7 User Documentation Edit File Utility Delete Word (DelWd) - ctrl F5 Delete the word from the present cursor position to either the beginning of the next word or to the end of the line. This word is placed in a delete word buffer which can be restored with the "Undelete Word" function. First Word of Line (FstWd) - ctrl F3 (TI - alt Left) Move the cursor to the first non-blank character on the present line. Last Word of Line (LstWd) - ctrl F4 (TI - alt Right) Move the cursor after the last non-blank character on the present line. This is useful when you want to add something to the end of the present line. Next Word (NxtWd) - ctrl Right Move the cursor forward to the beginning of the next word either on the current line or on a following line. Undelete Word (UndWd) - ctrl F7 Insert the last word deleted with the "Delete Word" function at the present cursor position if it will fit on the present line. 2.4.3 Miscellaneous Key Functions This section describes several miscellaneous editor functions. The cursor can be moved to the boundaries of the screen by using shift with the first four function keys. The ctrl Page Up/Page Down keys will move a specific line up or down in the window. The following table gives the default miscellaneous key assignments. Editor Miscellaneous Functions shift F1 BotLn Bottom Row of Window shift F2 TopLn Top Row of Window shift F3 BegLn Left Margin shift F4 EndLn Right Margin ctrl PgDn LnDwn Line Down One Row ctrl PgUp LnUp Line Up One Row These functions are described in the following paragraphs. Bottom Row of Window (BotLn) - shift F1 (TI - shift Down) Move the cursor to the bottom row of the edit window or to the last line of the file, whichever comes first, without changing the cursor column position. Left Margin (BegLn) - shift F3 (TI - shift Left) Move the cursor to the left margin on the present line. Line Down One Row (LnDwn) - ctrl PgDn (TI - ctrl Down) Move the present line down one row in the edit window while leaving the cursor on the same line and column. This function is useful for centering or moving a specific line within the window. 2-8 User Documentation Edit File Utility The line cannot be move past the bottom row of the window. Line Up One Row (LnUp) - ctrl PgUp (TI - ctrl Up) Move the present line up one row in the window while leaving the cursor on the same line and column. This function is useful for centering or moving a specific line within the window. The line cannot be move past the top row of the window. Right Margin (EndLn) - shift F4 (TI - shift Right) Move the cursor to the right margin on the present line. Top Row of Window (TopLn) - shift F2 (TI - shift Up) Move the cursor to the top row of the edit window without changing the cursor column position. 2.4.4 Alternate Key Functions Several editor functions are invoked by using the "alt" key together with one of the letter keys. The functions are assigned to keys based on their function name. These functions are listed in the following table. Editor "alt" Key Functions A AdjLn Adjust Line Mode C CenLn Center Line D DupLn Duplicate Previous Line F Fill Fill Paragraph H Help Help Function J Join Join Line P Paste Paste Line S Split Split Line T SetTb Set Tab Stop U Undo Undo Line Changes These functions are described in the following paragraphs. Adjust Line Mode (AdjLn) - alt A Adjust the characters to the right of the cursor on the line to the left or right by inserting blank characters or deleting characters. This function enters a special mode which displays the following line at the bottom row of the screen. Adjust Mode: DelCh-Left, InsCh-Right, Down, Up, CmdMd-Quit In this mode, the "Delete Character" function will delete a character under the cursor and move the rest of the line to the left one position. The "Insert Character" function will insert a blank character at the cursor and move the rest of the line to the right one position. The "Down One Line" and "Up One Line" functions will repeat the current adjustment on a previous or following line. If the "Down One Line" or "Up One Line" functions are used to move toward the original adjusted line, the adjustment will be reversed to restore the line to its original 2-9 User Documentation Edit File Utility appearance. The "Command Mode" function is used to terminate the adjust line mode. Center Line (CenLn) - alt C Center the text on the current line between the left and right margins. Duplicate Previous Line (DupLn) - alt D Duplicates the characters of the previous line from the present cursor position to the next tab position on the present line. This function is useful for copying all or part the previous line to the present line. Fill Paragraph (Fill) - alt F Fill the text in a paragraph to the right margin. The end of the paragraph is indicated by a blank line or end-of-line. Help Function (Help) - alt H Invoke the help utility to display the meaning of the editor functions. Join Line (Join) - alt J Join part or all of the text on the next line to the present line. The text is added either after the present cursor position or after the end of line. Paste Line (Paste) - alt P Paste the line currently in the line delete buffer to the present line. The first non-blank character in the line delete buffer is placed at the present cursor position. This function is useful for moving part of a line to a specific place on one or more lines. Split Line (Split) - alt S Delete the characters on the present line from the cursor position to the right margin. A new line with the deleted characters is then inserted after the present line, and the cursor is placed at the first non-blank character of the new line. Set Tab Stop (SetTb) - alt T Sets a tab stop or clears a tab stop at the current cursor column position. Undo Line Changes (Undo) - alt U Restore the current line to its original appearance before the latest set of changes were made. This is useful, when a line is changed inadvertently by any of the editing functions including text changes, to restore it to its appearance before the changes were made. 2-10 User Documentation Edit File Utility 2.4.5 Control Key Functions Many of the editor functions may be invoked by using the "ctrl" key together with one of the letter keys. This is useful for those people which prefer to invoke functions without removing their hands from the keyboard. The following figure gives the default assignments of the control keys to editor functions. Editor Control Key Functions - Part 1 +-----------+-----------+-----------+-----------+-----------+ | InsMd | InsLn | InsCh | RepNx | BegFl | | Q | W | E | R | T | +-+---------+-+---------+-+---------+-+---------+-+---------+-+ | DelEL | DelLn | DelCh | FndNx | UndLn | | A | S | D | F | G | +-+---------+-+---------+-+---------+-+---------+-+---------+-+ | | | CtlCh | | EndFl | | Z | X | C | V | B | +-----------+-----------+-----------+-----------+-----------+ Editor Control Key Functions - Part 2 +-----------+-----------+-----------+-----------+------------+ | PgUp | BegLn | Tab | BkTab | EndLn | | Y | U | I | O | P | +-+---------+-+---------+-+---------+-+---------+-+----------+ | BkSp | Down | Up | Right | | H | J | K | L | +-+---------+-+---------+-+---------+-----------+ | PgDwn | Retrn | | N | M | +-----------+-----------+ Most of these functions are described in previous sections but some which are assigned to control keys only are described in the following paragraphs. Enter Control Character (CtlCh) - ctrl C Enter a control character which would normally be used to invoke an editor function. This function accepts the next control character entered and either adds it or inserts it depending on the Insert Character mode. Find Next String (FndNx) - ctrl F Find the next occurrence of the last string found. The search begins one position past the present cursor position. The cursor is positioned on the first character of the string if it is found, otherwise the cursor is not moved and a "beep" is sounded. Since Find String and Replace String use the same target string, this function will search the file for the target string to verify the next replace operation. The "Replace Next String" function will replace the target string. 2-11 User Documentation Edit File Utility Replace Next String (RepNx) - ctrl R Replace the next occurrence of the last string replaced. The search begins at the present cursor position. If the target string is replaced, the cursor is positioned after the last character of the replacement string, otherwise the cursor is not moved and a "beep" is sounded. 2.5 Editor Commands The Editor in command mode provides of set of commands which operate on the file as a whole or require additional prompts. Command mode is invoked from edit mode with the ESC key or the "Command Mode" function. The top row of the screen is used as the command line. A command is invoked by entering the first letter of the command word. The ESC key can be used to abort any command prompt. If a command needs additional information such as a file pathname or string, the RETURN key must be used to terminate the prompt input. The following table lists the Editor commands, with any subcommands, and their meanings. 2-12 User Documentation Edit File Utility Editor Commands Block - Block commands Adjust - Adjust block left or right Box mode - Switch to box mode operations Copy - Copy block after or box to current line Delete - Delete block or box Help - Display help information for Block commands Line mode - Switch to line mode operations Move - Move block after or box to current line Put - Put block to file Find - Find string in file Help - Display editor help information Insert - Insert file after current line Modify - Modify editor parameters and options Colors - Modify colors used by editor Help - Help information for Modify commands Key - Redefine editor key mapping Characters - Define key to special characters Functions - Define key to editor functions Help - Help information for Modify Key commands Load - Load key definitions file Quit - Quit key definitions Save - Save key definitions in file Options - Modify editor options Help - Help information for Modify Options commands Load - Load options definitions file Modify - Modify option value Quit - Quit options definitions Save - Save options definitions in file Tabs - Modify tabs and margins Tabs - Set tabs, left margin, & right margin Position - Position file to specific line Quit - Quit commands Abort - Abort edit session Help - Help information for Quit commands Replace - Replace input file Save - Save modified module in specified file Replace - Replace string with specified string Show - Show external file Update - Update input file and continue editing The supported commands and any additional prompts are described in the following paragraphs. Block Invoke one of the block commands on the selected block or box. The "Mark Block" function is used to select the block to be operated on by these block subcommands. One of two command lines is displayed depending on the mode. The first command line displays the line oriented block commands, and the second command line displays the box oriented block commands. These command lines are shown below followed by the subcommand descriptions. Block [Line mode] - Adjust, Box mode, Copy, Delete, Help, Move, Put Block [Box mode] - Copy, Delete, Help, Line mode, Move 2-13 User Documentation Edit File Utility Adjust Adjust the the selected block of lines to the left or right. If a positive number is specified, the lines in the selected block are moved to the right by inserting the requested number of blanks at the left margin. Otherwise if a negative number is specified, the lines in the selected block are moved to the left by deleting characters at the left margin. The amount to be adjusted and the direction is requested by the following prompt. Adjust Block - Enter relative adjustment: Box mode Switch to box mode for block commands. Copy In line mode, the selected block of lines is copied and inserted after the present line of the file. In box mode, the selected box of characters is copied. The current cursor location defines the upper left hand corner of the destination. Delete In line mode the selected block of lines is deleted. Since a block delete is a destructive process, confirmation is requested by the following prompt. A single character is required where "Y" or "y" deletes the block and anything else aborts the delete block operation. Delete Block? (Yes/No) In box mode the selected box of characters is erased and replaced with blanks. Help Display Help information for Block commands. Line mode Switch to line mode for block commands. Move In line mode, the selected block of lines is moved and inserted after the present line of the file. The selected block is then deleted. In box mode, the selected box of characters is moved. The current cursor location defines the upper left hand corner of the destination. The selected box of characters is erased and replaced with blanks. Put Output the selected block of lines to the file requested by the following prompt. Put Block - Enter pathname: If the specified file exists, the following prompt confirms whether it should be replaced. Replace File [<file name>]? (Yes/No) 2-14 User Documentation Edit File Utility To replace the file enter a single "Y" or "y". Anything else will abort the put block operation. The old version of the specified file is saved using the extension "BAK". Find Find the string requested by the following prompt. The string must be specified exactly including blanks and case. The search begins after the present cursor position. If the string is found, the cursor is positioned at the beginning of the string. Otherwise the file is not repositioned and a "beep" is sounded. Find String - Enter string: The "Find Next" function will find the next occurrence of the specified string. string. Help Display the Help information for the editor commands and their descriptions. Insert Insert the file requested by the following prompt after the present line of the file. Insert File - Enter pathname: Modify Colors Invoke interface to redefine color assignments for various display lines. This utility is described in Section 1.5 of the Introduction. Modify Key Invoke interface to redefine key assignments for editor functions and special characters. The key definition command line is shown below followed by the subcommand descriptions. Define Keys - Characters, Functions, Help, Load, Quit, Save Characters Define key to be a special character. Press the key to be defined followed by the hexadecimal number of the character to be associated with the key. Functions Define key to be an editor function. Press the key to be defined followed by the decimal number of the function to be associated with the key. Help Display Help information for Modify Keys commands. Load Load a key definitions file. The default file is named "<dfedit>\EDITKEYS.DAT". Quit Quit the key definitions command and return to the editor. 2-15 User Documentation Edit File Utility Save Save the key definitions in a file. The default file is named "<dfedit>\EDITKEYS.DAT". Modify Options Update the options for the editor. The modification command line is shown below followed by the subcommand descriptions. Modify options - Help, Load, Modify, Quit, Save, Tabs Help Display Help information for Modify options commands. Load Load editor options file. The default file is named "<dfedit>\EDITOPTS.DAT". Modify Modify the value associated with an option. Simply move the cursor next to the option to be modified. Quit Quit the editor options command and return to the editor. Save Save the editor options in a file. The default file is named "<dfedit>\EDITOPTS.DAT". Tabs Modify the current tabs and margins. This command is the same as the 'Modify Tabs' command which is described next. The editor options which can be modified are described below. Backup file as '<name>.bak' Each time a file is replaced, the old version of the file is saved with an extension of 'bak'. This option can be selected by specifing 'Yes' or not selected by specifing 'No'. Floating 'Return' key Each time the 'Retrn' function is used, the cursor normally moves to the first character of the next line. This option will allow the cursor to always move to the left margin rather than the first character. The normal floating return is selected by specifing 'Yes' or the fixed return is selected by specifing 'No'. Horizontal scroll size The amount by which a wide file move left or right within the display window is controlled by this parameter. The number of columns by which the file should be scrolled must be specified. Left margin The value of the left margin must be specified. It must be greater than 0. 2-16 User Documentation Edit File Utility Right margin The value of the right margin must be specified. It cannot be greater than 256. Use tabs to pack line Whenever a new line is added to a file or modified it can be packed using tab characters. Line packing using tab characters is selected by specifing 'Yes'. Blank character packing is selected by specifing 'No.' Vertical scroll size The number of lines by which the Page Up 'PgUp' and Page Down 'PgDn' functions scroll the file in the display window is controlled by this parameter. The number of line by which the file should be scrolled must be specified. Modify Tabs The ruler line with the current tabs and margins is displayed on the top row, and the cursor is placed on it. The left margin is indicated by the character "L", the right margin by the the character "R", and the tabs by the character "T". To delete an old setting for margins and tabs, replace the corresponding character with a blank or period ".". The following edit functions may be used when updating the tabs and margins. BkTab Back Tab BegLn Beginning of Line EndLn End of Line CmdMd Escape - abort modifications Left Left One Character Retrn Return - accept modifications Right Right One Character Tab Next Tab Position Position the file window to a specific line of the file or relative from the current file position. The new file position is requested by the following prompt. Position - relative (+num or -num) or absolute (num): If a number without a plus "+" or minus "-" sign is specified, then the file window is moved to the specified line number if it exists. If a number with a plus "+" sign is specified, then the file window is moved down or forward by the specified number of lines. Otherwise if a number with a minus "-" sign is specified, then the file window is moved up or backward by the specified number of lines. 2-17 User Documentation Edit File Utility Quit Quit the current edit session. The quit command line is shown below followed by the subcommand descriptions. An indication whether the file will be saved with or without internal tabs is given. Quit Edit - Abort, Help, Replace, Save Abort Abort the current edit session without saving the modified file. If any modifications have been made to the file, the following prompt requests confirmation to abort the edit session. To abort the edit session enter a single "Y" or "y". Anything else will not abort the edit session. Modifications made - Abort anyway? (Yes/No) Help Display Help information for Quit commands. Replace Quit the current edit session by replacing the original file. The original file is saved using the extension "BAK". Save Quit the current edit session by saving the modified file in the file requested by the following prompt. Quit Save - Enter pathname: If the specified file exists, the following prompt confirms whether it should be replaced. Replace File [<file name>]? (Yes/No) To replace the file enter a single "Y" or "y". Anything else will abort the quit edit operation. The old version of the specified file is saved using the extension "BAK". Replace Replace a string in the file being modified. The string to be replaced is requested by the following prompt. The string must be specified exactly including blanks and case. Replace String - Enter target string: The replacement string is requested by the following prompt. An empty replacement string can be used to delete the target string. Replace String - Enter replacement string: The search for the target string begins at the present cursor position. If the target string is found, it is replaced and the cursor is placed at the end of the replacement string. If the target string is not found or the replacement string will not fit on the line, a "beep" is sounded. The "Replace Next" function will replace the next occurrence 2-18 User Documentation Edit File Utility of the target string with the replacement string. The "Find Next" function will find the next occurrence of the target string, and the "Replace Next" function will then replace it. Show Invoke the Show File utility to display the file requested by the following prompt. The show file utility is described in a separate document. Show File - Enter pathname: Update Save the modified file in the original file, but do not terminate the edit session. The original file is saved using the extension "BAK". 2-19 User Documentation Show Directory Utility Section 3 Show Directory Utility 3.1 Introduction The show directory utility displays the names of a group of files in a directory. The display produced by this utility is similar to that produced by the standard DOS DIR command except that the file names are displayed in alphabetical order, and the list is display using the full screen. Using this utility, files can be copied, deleted, displayed, edited, printed, or renamed. This is done by simply positioning the cursor next to the file to be operated on and pressing a single key to invoke the function for the desired file. These file commands are described plus the keys which position the cursor and the list of files in the display. Finally a set of global commands allow another group of files to be displayed, or a specific file to be edited. 3.2 Tool Invocation The show directory utility is invoked by the following DOS command. SHOW <group_name> The <group_name> parameter can be any file specification of the form normally used with the standard DIR command. A simple drive name will display all the file names on a disk, or a file specification with the wild-card characters "?" or "*" will display only those file names that match the file specification. If the show directory utility is invoked without specifing a file name, all the files in the default directory on the default disk are displayed. 3.3 Screen Format The screen for this utility is divided into three parts. The first part is the top row which displays the command line and any additional prompts required by a command. These commands are described in the File Commands section. The second part is the middle of the screen between the top and bottom rows. This part displays the information for the files in the selected group and is called the display window. The top two rows of the display window are header lines which identify information in each column plus the name of the file group, the number of files in the group, the total number of bytes in the files, and the amount of space available on the disk. Each line gives the file name and extension, file size, and date and time of the last update. It also gives the attributes of the file, where 'A' indicates the archive flag, 'H' indicates the hidden file flag, 'R' indicates the read/only file flag, and 'S' indicates the system file flag. Directories are indicated with the attribute "DIR". The lines of file information are normally 3-1 User Documentation Show Directory Utility displayed in alphabetical order of file extension and then file name. The third part of the screen is the bottom row which gives the descriptions of the numeric function keys. These functions are described in the Display Functions section. An example of the format of the display window for the files on disk "A:" is shown below. A:\*.* 11 Files 291503 Used 64000 Available -Name & Ext- -Size- --Date-- -Time- -Attrs- README 1ST 3090 19-Apr-86 9:00p A . . . INSTALL BAT 400 19-Apr-86 9:00p A . . . DFEDIT DOC 107495 19-Apr-86 9:00p A . . . DFEDIT23 DOC 760 19-Apr-86 9:00p A . . . COLORS EXE 17498 19-Apr-86 9:00p A . . . EDIT EXE 54746 19-Apr-86 9:00p A . . . PF EXE 11532 19-Apr-86 9:00p A . . . ROFF EXE 17212 19-Apr-86 9:00p A . . . SF EXE 20538 19-Apr-86 9:00p A . . . SHOW EXE 68582 19-Apr-86 9:00p A . . . DFEDIT HLP 12752 19-Apr-86 9:00p A . . . 3.4 File Commands Several commands are provided which operate on a single file or multiple files. These commands provide many of the functions supported by standard DOS commands, but the user interface is much simpler. The file to be operated on is selected by placing the cursor on the line of the desired file. The first character of the command is then used to invoke the desired function. Multiple files can be selected by using the "Mark/Unmark" file function. A list of valid commands and a brief description of each is given in the following table. Archive - Copy all files with the archive flag to another disk Backup - Backup file or marked files to another disk drive Copy - Copy file or marked files to specified destination Delete - Delete file or marked files Edit - Invoke edit file utility Help - Display show directory help file Modify - Modify file or marked files attributes Print - Print file or marked files Quit - Quit show directory display Rename - Rename file or marked files to new name Show - Invoke show file utility Each of these commands is described in the following paragraphs. If the command has any additional prompts, they are also described. Archive Copy all the files in the current file group which have the "archive" flag set to another disk. A single destination drive letter (A to M) is requested. This command can be aborted with the ESC or RETURN key. Archive files to drive (A-M): 3-2 User Documentation Show Directory Utility Backup Copy the selected file or marked files from one disk to another disk. Since file backups should be made periodically, this command provides an easy way to copy a file from one disk to another without changing the name of the file. A single destination drive letter (A to M) is requested. This command can be aborted with the ESC or RETURN key. If the selected file is not marked, a single file backup is requested; otherwise a multiple file backup is requested. Backup file to drive (A-M): Backup multiple files to drive (A-M): Copy Copy the selected file or marked files to another file location. With this command only the destination file must be specified. The destination file name is requested by one the following prompts. Wild-card characters may be used when specifing the destination file name. An empty response to the prompt or the ESC key is used to abort the command. If the selected file is not marked, a single file copy is requested; otherwise a multiple file copy is requested. Copy file to: Copy multiple files to: If the destination file for the copy exists, confirmation to replace the file is requested by the following prompt. Replace file [<file name>]? (Yes/No) Delete Delete the selected file or marked files. Since this is a destructive process, confirmation is requested by one of the following prompts. If the selected file is not marked, a single file delete is requested; otherwise a multiple file delete is requested. Delete file? (Yes/No) Delete file [<file name>]? (Yes/No/All/Stop) For single file deletes, a "Y" will delete the file and anything else aborts the delete file operation. For multiple file deletes, confirmation for all files is requested. A "Y" will delete the file, a "N" will not delete the file, a "A" will delete all the marked files, and a "S" will stop the delete multiple files command. If the last file in the current list is deleted, the file group display is terminated. Edit Invoke the edit file utility to edit the selected file. The edit file utility is described in a separate document. The information for the selected file is updated to reflect the new file size and date and time of the modified file. 3-3 User Documentation Show Directory Utility Help Display the 'Help' information for the show directory commands and functions. Modify Modify the attributes for the selected file or marked files. The type of modification is requested by one of the following prompts. If the selected file is not marked, a single file modify is requested; otherwise a multiple file modify is requested. Modify file attributes (+|- AHRS): Modify multiple file attributes (+|- AHRS): This command uses a syntax for the modification which is similar to the DOS FILATR utility. The "+" indicates to set the flag and the "-" indicates to clear the flag. Print Invoke the print file utility to print the selected file or marked files. This utility copies the selected file to the printer optionally adding page headers which give the name of the file, current date and time, and page numbers. This is useful for printing text files such as program text or other unformated text files. If the file has embedded printer control characters such as form feeds, the file should be printed without page headers. If the selected file is not marked, a single file print is requested; otherwise a multiple file print is requested. Print file with page headers? (Yes/No/ESC) Print multiple files with page headers? (Yes/No/ESC) If page headers are desired respond with a "Y" otherwise if page headers are not desired respond with a "N". Use the ESC key to abort the print file command. Quit Terminate the current file group display. The commands described in the Global Commands section can then be used to display another group of files or to edit a specific file. Rename Rename the selected file or marked files to a new file name. The new file name is requested by one of the following prompts. After a file is renamed, the new file information line is inserted into the list of files and the old file information line is deleted. The drive should not be specified since files can only be renamed on the same disk. Wild-card characters can be used to specify the new file name. An empty response to the prompt or the ESC key is used to abort the command. If the selected file is not marked, a single file rename is requested; otherwise a multiple file rename is requested. Rename file to: Rename multiple files to: After a file is renamed, the new file information line is inserted into the list of files and the old file information line is deleted. 3-4 User Documentation Show Directory Utility Show Invoke the show file utility to display the selected file. The show file utility is described in a separate document. 3.5 Display Functions In order to select the file to be operated by the commands described in the previous section, the cursor must be moved to the line of the desired file. The functions to move the cursor and the list of files in the display window are described in this section. A list of the valid functions and their associated function key assignments is given in the following table. Bottom of List F4 Down One Line Down, RETURN Global Commands ESC Mark/Unmark File F6 Mark All Files F7 Reread Directory F5 Page Down F1, PgDn Page Up F2, PgUp Sort List F9 Top of Display HOME Top of List F3 Up One Line Up Unmark All Files F8 The display functions with their associated key assignments are described in the following paragraphs. Bottom of List - F4 Display the end of the list of files in the display window and place the cursor on the last file of the list. Down One Line - Down Arrow, Return Move the cursor down one line to the next file in display. If the cursor is on the bottom row of the window, the window is scrolled down one line. If the present line is the last file in the list, the cursor is not repositioned. Global Commands - ESC Invoke the Global Commands described in the next section. This allows another directory or file group to be displayed without terminating the current display. Mark/Unmark File - F6 Toggle the file mark on the current file. The file mark is indicated with an "*" in front of the file name. Mark All Files - F7 Set the file mark for all the files but not directories in the list. 3-5 User Documentation Show Directory Utility Reread Directory - F5 Reread the directory using the original file group name specification. The beginning of the new list of files is displayed in the window and the cursor is placed on the first file of the list. This function is useful to update the list of files after several new files have been created using the Copy command or edit file utility. Page Down - F1, PgDn Scroll the display window down or forward on the list of files. The cursor is left on the same relative row of the window unless the end of list is reached. If the last file of the list is already being displayed in the window, the list is not scrolled but the cursor is placed on the last file of the list. Page Up - F2, PgUp Scroll the display window up or backward on the list of files. The cursor is left on the same relative row of the window unless the beginning of list is reached. If the first file of the list is already being displayed in the window, the list is not scrolled but the cursor is placed on the first file of the list. Sort List - F9 Normally the file list is sorted on file extension and name. This function allows the files to be listed based on another sorting criteria which is requested by the following prompt. Sort list by - Date & time, Extension, Name, Size The option is selected by using the first letter of the option name. Date & time Sort the list on date and time so the oldest files are at the top of the list. Extension Sort the list on file extension and then file name. Name Sort the list on file name and then file extension, which is the normal sort. Size Sort the list on file size so the largest files are at the bottom of the list. Top of Display - HOME Move the cursor to the first file on the current display. Top of List - F3 Display the beginning of the list of files in the window and place the cursor on the first file of the list. Up One Line - Up Arrow Move the cursor up one line to the previous file in display. If the cursor is on the top row of the window, the window is scrolled up one line. If the present line is the first file in the list, the cursor is not repositioned. 3-6 User Documentation Show Directory Utility Unmark All Files - F8 Remove the file marks from all the files in the list. 3.6 Global Commands When a file group display is terminated with the Quit command, one of the following commands can be used to display another group of files, invoke the editor for a file, or terminate the utility completely. The first character of the command is used to invoke the desired function. The command line is shown below. Change dir, Dos command, Edit file, Help, Make dir, Quit, Show dir These commands are described in the following paragraphs. Change dir Change the default directory pathname for a disk. The directory name is requested by the following prompt. An empty response is used to abort this command. Change Directory - Enter pathname: Dos command Invoke the DOS command interpreter so that normal DOS commands can be invoked. The SHOW utility is still resident, so use the EXIT command to return to the SHOW utility. Edit file Invoke the edit file utility to edit the specified file. The file name is requested by the following prompt. An empty response is used to abort this command. Edit File - Enter pathname: Help Display the 'Help' information about the global commands. Make dir Make a new directory on a disk. The directory name is requested by the following prompt. An empty response is used to abort this command. Make Directory - Enter pathname: Quit Terminate show directory utility or return to the level which invoked it. Show dir Invoke the show directory utility to display another group of files in a directory. The directory name or file group name is requested by the following prompt. An empty response is used to abort this command. Show Directory - Enter pathname: 3-7 User Documentation Show File Utility Section 4 Show File Utility 4.1 Introduction The show file utility displays an ASCII text file through a logical window which can be moved forward and backward on the file. The show file utility is invoked by using the "Show" file command in either the edit file or show directory utilities and by the following DOS command where <file_name> is the name of the file to be displayed. SF <file_name> If the show file utility is invoked the DOS command without specifing a file name, the following prompt requests the file to be displayed. Show File - Enter pathname: In this mode the show file utility will continue to request the name of a file to be displayed until an empty file name or the ESC key is used to terminate the show file utility. 4.2 Screen Format The screen format is very simple with a command line at the top of the screen, a display window consisting of the middle 23 rows of the screen, and a file identification line at the bottom of the window. The command line gives the line number of the top line in the window, and the valid commands and functions. An example command line while displaying the first part of the editor help file named "A:\DFEDIT\EDIT1.HLP" is given below followed by the file identification line. F1-Down, F2-Up, F3-Top, F4-Bottom, Find, Help, Position, Quit File = A:\DFEDIT\EDIT.HLP Top = 1 The end of the file is indicated by a "*eof" line displayed in the file window after the last line of the file. 4.3 Commands and Functions The show file utility provides functions to move the window up or down on the file being displayed. These functions are invoked by function keys specified after the function name. Commands are provided to position the window to a specific line of the file and to quit the show file utility. These commands are invoked by using the first letter of the command name. Each of the commands and functions is described in the following paragraphs. 4-1 User Documentation Show File Utility Bottom of File - F4 Position the file window to the last line of the file. The Show File utility currently only displays files less than 32,500 lines. Find Find a string in the current file after the top line. If the string is found, the line with the string will be positioned at the top of the display. The following prompt requests the string or pattern to find. Find String - Enter string: The string can have special characters which are used to match characters. These special characters are listed below. ? matches any character s* matches zero or more occurrances of 's' s+ matches one or more occurrances of 's' \? matches a '?' \* matches a '*' \+ matches a '+' \\ matches a '\' Help Display the 'Help' information about the Show File utility. Line Down - Down Arrow Move the file window down to the next line of the file unless the window is already at the end of file. Line Up - Up Arrow Move the file window up to the previous line of the file unless the window is already at the first line of the file. Page Down - F1, PgDn Move the file window down or forward on the file by 20 lines to show the next section of the file. Page Up - F2, PgUp Move the file window up or backward on the file by 20 lines to show the previous section of the file. Position Position the file window to a specific line of the file or relative from the current file position. The new file position is requested by the following prompt. Position relative (+num or -num) or absolute (num): If a number without a plus "+" or minus "-" sign is specified, then the file window is moved to the specified line number if it exists. If a number with a plus "+" sign is specified, then the file window is moved down or forward by the specified number of lines. Otherwise if a number with a minus "-" sign is specified, then the file window is moved up or backward by the specified 4-2 User Documentation Show File Utility number of lines. Quit Terminate the show file utility and return to the utility which invoked it or to the DOS command handler. Top of File - F3 Position the file window to the first line of the file. 4-3 User Documentation Print File Utility Section 5 Print File Utility 5.1 Introduction The print file utility copies an ASCII text file to the printer optionally adding page headers which give the file name, current date and time, and page number. The print file utility is invoked by the "Print" file command in the show directory utility and by the following DOS command. PF <file_name> If the print file utility is invoked with the DOS command without specifing a file name, the following prompt requests the file to be printed. Print File - Enter pathname: In this mode the print file utility will continue to request the name of a file to be printed until an empty file name or the ESC key is used to terminate the print file utility. In this mode, a file can be printed with or without page headers. Your choice is requested by the following prompt. Print file [<file_name>] with page headers? (Yes/No/ESC) If page headers are desired respond with a "Y" or "y", or if the file is to be printed without page headers because it has internal printer control characters respond with a "N" or "n". To abort the print file process use the ESC key. 5.2 Print Format If a file is printed with page headers, the file name, current date and time, and page number is printed at the top of each page followed by 60 lines of the file. An example page header for the file named "A:\DFEDIT\EDIT.HLP" is shown below. PF 2.3 19-Jan-86 12:30:40 A:\DFEDIT\EDIT.HLP Page 1 5-1 User Documentation Text Formatter Utility Section 6 Text Formatter Utility 6.1 Introduction The text formatter utility produces a neatly formatted version of a input text file, with optional page headers and footers and with output lines filled to a uniform right margin. This utility is taken from the text formatter utility described in Chapter 7 of Software Tools in Pascal by Brian W. Kernighan and P. J. Plauger. This utility accepts text to be formatted, interspersed with formatting commands telling what the output is to look like. A command consists of a period, a two-letter name, and perhaps some optional information. Each command must appear at the beginning of a line, with nothing on the line but the command and it arguments. For instance, .ce centers the next line of output, and .sp 3 generates three spaces (blank lines). You do not have to know much about the commands and arguments, because most formatting happens automatically. A document containing no commands is printed sensibly. Default parameter settings and formatting actions causes words to fill up output lines as much as possible, regardless of the length of input lines. Blank lines cause fresh paragraphs. Input is correctly spaced across page boundaries, with top and bottom margins. The text formatter is invoked by the following MS-DOS command. ROFF <input_file> <output_file> The <input_file> is the name of the file which contains the text to be formatted with interspersed commands. The <output_file> is the name of the file to which the formatted text is sent. The printer can be specified as the output file by using the file name "LST" or "PRN". If an <output_file> is not supplied, the output is sent to the standard output device which is normally the screen. 6.2 Commands A command line consists of a period '.' at the beginning of the line (column 1), followed by a two letter command name, possibly with optional arguments separated by one or more blanks and tabs from the command name. Multiple commands can be included on a command line by terminating a command with a semicolon ';', plus a leading period '.' for the next command. 6-1 User Documentation Text Formatter Utility By default ROFF 'fills' output lines, by packing as many input words as possible onto an output line before printing it. The lines are also 'justified' (right margins made even) by inserting extra blanks into the filled line before output. This fill option can be turned off by the 'no-fill' command .nf and thereafter lines will be copied from input to output without any rearrangement. Filling can be turned back on with the 'fill' command .fi When an '.nf' is encountered, there may be a partial line collected but not yet output. The '.nf' will force this line out before anything else happens. The action of forcing out a partially collected line is called a 'break'. The break concept revades ROFF; many commands implicitly cause a break. To force a break explicitly, for example to separate two paragraphs, use .br Of course you may want to add an extra blank line between paragraphs. The 'space' command .sp causes a break, then produces a blank line. To get 'n' blank lines, use .sp n (A blank is always required between a command name and its argument.) If the bottom of a page is reached before all the blank lines have been printed, the excess ones are thrown away, so that all pages will normally start at the same first line. By default output will be single spaced, but the line spacing can be changed at any time: .ls n set line spacing to 'n'. (n=2 is double spacing.) The '.ls' command does not cause a break. The 'begin page' command '.bp' causes a skip to the top of a new page and also causes a break. If you use .bp n the next output page will be numbered 'n'. A '.bp' that happens to occur at the bottom of a page has no effect except perhaps to set the page number; no blank page is generated. The current page length can be changed (without a break) with .pl n 6-2 User Documentation Text Formatter Utility To center the next line of output, .ce line to be centered The '.ce' command causes a break. You can center 'n' lines with .ce n and, if you don't like to count lines (or can't count correctly), say .ce 1000 lots of lines to be centered ... .ce 0 The lines between the '.ce' commands will be centered. No filling is done on centered lines. Underlining is much the same as centering: .ul n causes the text on the next 'n' lines to be underlined upon output. But '.ul' does not cause a break, so words in filled text may be underlined by words and words and .ul lots more words. to get words and words and lots more words. ____ ____ Centering and underlining may be intermixed in any order: .ce .ul This is a Title gives a centered and underlined title. The 'indent' command controls the left margin: .in n causes all subsequent output lines to be indented 'n' positions. (normally they are indented by 0.) The command .rm n sets the 'right margin' to 'n'. The line length of filled lines is the 6-3 User Documentation Text Formatter Utility difference between right margin and indent values. '.in' and '.rm' do not cause a break. The traditional paragraph indent is produced with 'temporary indent' command: .ti n breaks and sets the indent to position 'n' for one output line only. To put running header and footer titles on every page, use '.he' and '.fo': .he This becomes the top of page (header) title .fo This becomes the bottom of page (footer) title The title begins with the first non-blank after the command, but a leading single or double quote will be discarded if present, so you can produce titles that begin with blanks. If a title contains the character '#', it will be replaced by the current page number each time the title is actually printed. '.he' and '.fo' do not cause a break. Since absolute numbers are often awkward, ROFF allows 'relative' values as command arguments. All commands that allow a numeric argument 'n' also allow '+n' or '-n' instead, to signify a change in the current value. For instance, .rm -10 .in +10 shrinks the right margin by 10 from its current value, and moves the indent 10 places further to the right. Thus .rm 10 and .rm +10 are quite different. Relative values are particularly useful with '.ti', to temporarily indent relative to the current indent: .in +5 .ti +5 produces a left margin indented by 5, with the first line indented by a further 5. And .in +5 .ti -5 produces a 'hanging indent', as in a numbered paragraph. A line that begins with blanks in a special case. If there is no text at all, the line causes a break and produces a number of blank lines 6-4 User Documentation Text Formatter Utility equal to the current line spacing. If a line begin with 'n' blanks followed by text, it causes a break and a temporary indent of '+n'. These special actions help ensure that a document that contains no formatting commands will still be reasonably formatted. To summarize, each of the valid commands is described briefly in the following table. The letter 'n' indicates that the command allows an optional numeric argument. If a numeric argument is preceded by a + or -, the current value is changed by the amount; otherwise the argument represents the new value. The symbol "str" indicates that a string of characters is needed by the command. For the copy file command ".co" the string indicates a file name. Certain commands cause a "break" in the processing of input text lines, i.e., any partially filled line is output and a new line is begun. If no argument is given, the default value is used. command break? default function _______ _____ _______ ________ .ad yes start right margin adjust .bd n no n=1 double print next n lines .bp n yes n=+1 begin page numbered n .br yes cause break .ce n yes n=1 center next n lines .co str yes copy file (up to 4 levels) .fi yes start filling .fo str no empty footer title .he str no empty header title .in n no n=0 indent n spaces .lm n no n=5 set left margin to n .ls n no n=1 line spacing is n .na yes stop right margin adjust .ne n yes n=1 need n lines on page .nf yes stop filling .pc str no output printer control .pl n no n=62 set page length to n .rm n no n=75 set right margin to n .sp n yes n=1 space down n lines .ti n yes n=0 temporary indent of n .ul n no n=1 underline next n lines 6.3 Extra Formatting Rules The '^' character can be used to produce a non adjustable blank character. Normally a period '.' followed by one or more blanks will be output with two trailing blanks. The '@' character is an escape character which will output the next character. It can be used to output either the '^' or '@' characters. The title header and footer lines can have the form of a single line of text with an optional leading single or double quote character. This form is output starting at the left margin. The title can also have a left part, a center part, and a right part using the format "\left\center\right\". The '#' character in the title will output the current page number. 6-5