SESSION 3. The following subjects will be covered in this session: string search and replacement handling of blocks of text Every word processing program has to be able to find a given phrase within the edited text. In this tutorial, the term "string" will be used for such a phrase (a small portion of the edited text). A word has been defined in the first session as a sequence of characters delimited by blanks. A string can be a word (or its fraction) or it can consist of a few words separated by blanks. Text buffers in WORDFLEX can be searched for strings of up to 70 characters. Strings can be also automatically replaced in one or more lines of the text buffer. The search only is performed by invoking the Alt F (for find) command. Press Alt F now. You will be asked whether the entire text is to be searched. WORDFLEX expects an affirmative (y or Y) or negative (n or N) answer to this and all similarly phrased questions. You will notice that any other character is ignored. An affirmative answer means that the text will be searched from the beginning. Negative answer will invoke a search in the portion of the ***Press Ctrl Pg Dn*** buffer starting with current line to the end of the text. Answer y (or Y) and specify as a string the title of this session: SESSION 3. Almost instantly this screen will be displayed with the title on the first line. You will be then asked whether a search for the next occurrence of the string is desired. Answer y (Y) again. Now one of the lines above will become the top line. Another affirmative answer will result in the message "String not found" and the display will remain unchanged. The replace command is invoked by Alt R and it works very much like the Alt F command. You have to specify, however, in addition to the search string, the replacement string. The found string is again displayed for a brief period of time, than the line turns cyan (high intensity) and it is displayed again with the replacement. You can either accept or reject that particular string replacement. Try now the Alt R command on this text, replacing the string Alt R with ALT R and back again. The second subject of this session is handling of blocks of text. Block of text is defined as two or more lines marked in a special way. Before we get to the commands for handling these blocks, a special command that operates on a single line has to be mentioned. The Alt D command ***Press Ctrl Pg Dn***  -2- deletes a line from a buffer irretrievably. It is different from the individual character deletion invoked by the Del key. The Del key cannot be used to erase an entire line of text; it can only delete all characters in a line making it a blank line. Also, the deletion of characters is reversible while deletion of lines (and blocks of text, as you will see shortly) is not. Consequently, caution has to be exercised when using the Alt D command. The following special function keys are used to define and access a block of text: F5 - moves cursor to mark 1 or 2 F7 - marks an unmarked line or unmarks a marked line F8 - erases marks Only one text block can be marked in WORDFLEX at a time. The block is delimited by two marked lines (they are part of the block). Line marked as 2 has to follow line marked as 1 in the text and both marked lines have to be in the same buffer. ***Press Ctrl Pg Dn*** The following commands are used to manipulate blocks of text: Alt C - inserts block of text after the current line and leaves the original block intact Alt E - erases block of text irretrievably Alt M - inserts block of text after the current line and removes if from its original location The important feature of the Alt C and Alt M command is that it allows transfer of blocks of text between two separate buffers. When such a transfer is invoked, a confirmation is requested. If approved, the copying or moving operation proceeds, thus allowing the pasting together of text from different file buffers. The marked line is displayed in reversed video for an emphasis. The F5 command will move the cursor to the selected mark. The Alt S command provides information about the status of the marks. Now load a text file (perhaps your own file test.txt) on the next two buffers and practice the line deletion, marking and manipulation of blocks. ***Press Ctrl Pg Dn***  -3- Unlike the commands described in Session 2, all block manipulation commands are irreversible. It is, of course, always possible to move a block back where it came from or erase a copied block that was marked incorrectly. It is not possible, however, to recover from an erasure of a block of text. This is one of the reasons why a periodic storage of the text buffer on a file should be performed during a lengthy editing session. Even in a case of an inadvertent error, the loss of text can be thus minimized. This concludes the third WORDFLEX tutorial session.