(edited 21-Jun) (Writing with KED\writ_chap)

(Writing with KED) This chapter describes the KED functions and commands you can use to write any kind of text file, such as a source program, a chapter in a book, a figure or table, or a list of names and addresses.

The keyboard ((main_sec)) contains the keys you use to insert text.

Certain function keys and commands let you perform additional text-entry operations: (UNNUMBERED) Inserting nonprinting characters ((nonprint_sec)) Using special line terminators ((term_sec)) Setting the right margin ((margin_sec)) (Using the Keyboard\MAIN_SEC)

(Usingkeyboard) (Keyboard, using) The keyboard contains the keys you use to insert text: (simple) Printing character keys Shift key Return key Space bar Tab key Delete key

You cannot insert any text by pressing keys on the keypad. (Printing Character Keys)

(Printing character keys) (Character keysprinting) (Keyboard keysprinting character) (Usingprinting character keys) (Usingcharacter keys) The printing character keys give you alphabetic characters, numeric characters, punctuation marks, and special symbols.

When you type a printing character key, KED inserts the character at the point where the cursor is located. (Shift Key)

(Shift keyboard key) (Keyboard keysshift) (Usingshift key) The shift key, (SHIFT), lets you type alphabetic characters in uppercase and select the upper character on keys that give you two characters, as on a typewriter. (Return Key)

(Return keyboard key) (Keyboard keysreturn) (Return function) (Functionsreturn) (Usingreturn key) The return key, (RETURN), ends your current line of text and begins a new line. (Space Bar)

(Space bar, keyboard) (Keyboard keysspace bar) (Usingspace bar) The space bar lets you add spaces in a line of text. (Tab Key)

(Tab keyboard key) (Keyboard keystab) (Tab function) (Functionstab) (Usingtab key) The tab key, (TAB), performs the same function as on a typewriter. (Delete Key)

(Delete () keyboard key) (Keyboard keysdelete ()) (Usingdelete () key) The delete key, (), lets you delete any errors you make while typing in text or responding to KED prompts.

When you press (), KED deletes the character preceding the cursor and stores it in the deleted character buffer. (Inserting Nonprinting Characters\NONPRINT_SEC)

(Insertingnonprinting characters) (Nonprinting charactersinserting) (Charactersnonprintinginserting) Any text file you create with KED consists of two kinds of characters: printing characters and formatting characters. (UNNUMBERED) Printing characters include uppercase and lowercase alphabetic (Printing characters) (Charactersprinting) characters, numeric characters, punctuation marks, blank spaces, and special symbols, such as the dollar sign ($) and the asterisk (*). Formatting characters are nonprinting characters that cause your terminal (Formatting characters) (Charactersformatting) to end the current line of text and begin a new line or to tabulate.

(asci_ax) contains a complete list of nonprinting characters and their decimal ASCII equivalents. The nonprinting characters you can use depends on your operating system.

To enter a decimal ASCII equivalent, use the SPECINS (special insertion) (Keypad keysSPECINS) (SPECINS function) (FunctionsSPECINS) function. (numbered) Press (GOLD). Type the decimal ASCII equivalent, using the numeric keys on your keyboard.

KED displays its (Repeat:) prompt and the number you typed. Press (GOLD) and (SPECINS).

KED inserts the nonprinting character that corresponds to the decimal ASCII equivalent you typed.

In other words: (simple) ((GOLD)) (number (GOLD) (SPECINS))

(lf_sec) gives you an example of that procedure, which is used to insert a nonprinting line-feed character in a file. (Using Special Line Terminators\TERM_SEC)

(Usingspecial line terminators) (Usingline terminators) (Special line terminatorsusing) (Line terminatorsusing) A text line consists of a string of printing characters followed by a nonprinting character or combination of nonprinting characters called a line terminator.

The most commonly used line terminator is the new-line terminator that KED inserts in your file each time you press (RETURN). It consists of two nonprinting characters: (simple) The carriage-return character, which moves the cursor to the left margin The line-feed character, which moves the cursor down one line

Three additional line terminators are available for your use in formatting text: (simple) The form-feed terminator ((ff_sec)) The line-feed terminator ((lf_sec)) The vertical-tab terminator ((vt_sec))

The form-feed terminator is often used, as it marks pagination in a document; it causes the printer to procede to the next page of text. The line-feed and vertical-tab terminators, however, are used only in rare circumstances. (Form-feed Terminator\ff_sec)

(Form-feed terminator) (Special line terminatorsform feed) (Line terminatorsform feed) A form-feed causes KED to start displaying characters at the left margin of the next line. A form-feed also causes most printers to cease printing text on the current sheet.

To insert a form-feed character in your text, press (CTRL/L). (Keyboard keysCTRL/L) (CTRL/L function) (FunctionsCTRL/L)

For example, type: (This is what(CTRL/L)a form feed does.)

KED displays: (This is what(F\F)) (a form feed does.)

Typically, the text (This is what) would be printed as the last line on one sheet and the text (a form feed does) would be the first line printed on the next sheet. (Line-feed Terminator\lf_sec)

(Line-feed terminator) (Special line terminatorsline feed) (Line terminatorsline feed) A line-feed line terminator (not the (LF) keyboard key) causes KED to start displaying characters on the next line, directly below the place where you insert the line-feed character.

To insert a line-feed character in your text: (NUMBERED) Press (GOLD). Type the decimal ASCII equivalent for the line-feed character (10). Press (GOLD) and (SPECINS).

In other words: (simple) ((GOLD)) (10 (GOLD) (SPECINS))

For example: (NUMBERED) Type: (Half of this sentence) Type:

((GOLD)) (10 (GOLD) (SPECINS))

KED moves the cursor to the corresponding position in the next line down. (Half of this sentence) ( ( )) To complete the sentence, type: ( is on the next line.)

That gives you: (Half of this sentence) ( is on the next line.( )) (Vertical-tab Terminator\vt_sec)

(Vertical-tab terminator) (Special line terminatorsvertical tab) (Line terminatorsvertical tab) A vertical-tab causes KED to start displaying characters at the left margin of the next line.

To insert a vertical-tab character in your text, press (CTRL/K). (Keyboard keysCTRL/K) (CTRL/K function) (FunctionsCTRL/K) (Control keysSee CTRL/)

For example, type: (The vertical tab(CTRL/K)starts a new line.)

KED displays: (The vertical tab(V\T)) (starts a new line.) (Setting the Right Margin\MARGIN_SEC)

(Settingright margin) (Right margin, setting) (Margin, setting right) You can set the right margin for new text ((newtext_sec)) or change the right margin for existing text ((existext_sec)). (New Text\newtext_sec)

(New text, setting right margin) (Textnewsetting right margin) By default, KED lets you type any number of text lines, up to the limit that KED places on the size of your output file. When you reach the last character space on your screen, KED moves the cursor to the beginning of the next line, displays a continuation (Continuation symbol) (Symbolscontinuation) symbol ((full_diamond)), and continues the line. To end the line before that point and begin a new one, you must press (RETURN) (or insert another line terminator described in (term_sec)).

If you wish, you can specify a maximum line length for the text you are creating. The operation is equivalent to setting an automatic right margin on a typewriter.

To specify a maximum line length: (NUMBERED) Press (GOLD) and (COMMAND). In response to the command prompt, type: (SET WRAP command) (CommandsSET WRAP) (SET WRAP [number])

(number) is the maximum number of characters that your new text lines will contain. You can specify any number from 1 to 256.

If you do not specify a number, KED uses a default of 78 if your screen width (Screen width defaults) (Defaultsscreen width) is 80 characters or a default of 130 if your screen width is 132 characters (that leaves 2 characters for a nonprinting line terminator). Press (ENTER).

In other words: (simple) ((GOLD) (COMMAND)) (SET WRAP [number] (ENTER))

As you type in text, KED inserts a nonprinting line terminator after the last complete word it can fit on the current line, and then begins a new line. Exceptions: (unnumbered) If you type a single word that is longer than the maximum number of characters you specified for the right margin, KED leaves the word in a text line by itself. If you press (TAB), KED processes it normally, and usually the text line that contains the horizontal-tab character reaches past the specified right margin. If you press (RETURN), KED begins a new line. If you insert a carriage-return character by itself, KED overwrites the beginning of the text line that contains that character.

The SET WRAP command also gives you a convenient way to ensure that the text lines you type stay within the limits of your screen. For example, if your screen width is 80 characters, type: (simple) ((GOLD) (COMMAND)) (SET WRAP (ENTER))

KED sets a maximum line length of 78 characters (the default). When you reach the 78-character limit, KED inserts a line terminator after the last complete word that can fit on the line and then begins a new line.

To set a different maximum line length: (simple) ((GOLD) (COMMAND)) (SET WRAP new-number (ENTER))

To cancel the SET WRAP operation: (simple) (SET NOWRAP command) (CommandsSET NOWRAP) ((GOLD) (COMMAND)) (SET NOWRAP (ENTER)) (Existing Text\existext_sec)

(Existing text, setting right margin) (Textexistingsetting right margin) To change a right margin for existing text or set a right margin for unformatted text, use the SET WRAP command, the SELECT function, and the FILL function or command. (NUMBERED) Issue the SET WRAP command to specify the line length. (ALPHABETIC) Press (GOLD) and (COMMAND). In response to the command prompt, type: (SET WRAP [number])

(number) is the maximum number of characters the line will contain. You can specify any number from 1 to 256. (If you specify 1, word is placed on its own line.)

If you do not specify a number, KED uses a default of 78 if your screen width is 80 characters or a default of 130 if your screen width is 132 characters (that leaves 2 characters for a nonprinting line terminator). Press (ENTER). Use the SELECT function to select the lines you want to reformat. (Keypad keysSELECT) (SELECT function) (FunctionsSELECT) (ALPHABETIC) Move the cursor (as described in (curs_chap)) to the beginning of the first line you want to reformat. Press (SELECT). Move the cursor to the end of the last line you want to reformat.

As you move the cursor, KED highlights your selection by reversing the text and background or by underlining your selection. If you make a mistake in selecting lines, press (GOLD) and (RESET). Use the FILL function or command to reformat the lines you selected.

To use the FILL function, press (GOLD) and (FILL). (Keypad keysFILL) (FILL function) (FunctionsFILL)

To use the FILL command: (FILL command) (CommandsFILL) (ALPHABETIC) Press (GOLD) and (COMMAND). In response to the command prompt, type: (FILL) Press (ENTER).

In other words: (simple) ((GOLD) (COMMAND)) (SET WRAP [number] (ENTER)) Move the cursor to the beginning of the first line. ((SELECT)) Move the cursor to the end of the last line. Then: ((GOLD) (FILL)) or ((GOLD) (COMMAND) (FILL) (ENTER))

KED reformats the lines you selected according to the line length you specified. Specifically, KED: (UNNUMBERED) Inserts a single space in place of spaces and horizontal tabs. Substitutes a single space for carriage-return and line-feed characters, whether alone or combined as new-line terminators.

The fill operation joins paragraphs that are separated by blank lines created by carriage-return/line-feed combinations. To avoid having your paragraphs joined, process each paragraph with a separate FILL function or command or use vertical tabs ((vt_sec)) or form feeds ((ff_sec)) to separate your paragraphs.

The fill operation is not affected by the SET NOWRAP command. If you use a FILL function or command after using a SET NOWRAP command to disable a set wrap operation, KED continues to use the line length you specified with the SET WRAP command. (What Next?)

Now that you have learned to use your terminal as a typewriter, to begin and end a work session, and to write any kind of text file, you are ready to explore the full power of KED to perform many useful editing operations.

First, however, you should learn all you need to know about moving the cursor, as described in (curs_chap). That chapter shows you how to move the cursor: (simple) Character by character Word by word Line by line Section by section Page by page To the end or beginning of your text file Directly to any point in your text file