Copyright 1991 Sudden Incorporated, Rod Coleman Locating Text It doesn't help to get around a file fast, if you don't know where you're going. Last Change and Find will help you to locate the text you're interested in. Last Change will take you back to the last places you have been editing text. It's real handy for returning to your work, after you have been out exploring. Find works in a dynamic fashion using partial keys. This means that it searches as you enter the pattern. Don't worry, you'll see what I mean. Find not only locates words and phrases; it also can be used to navigate around the file by using unique markers in combination with the Search Patterns feature. This and other tricks are presented below. Wherever there's a Find function, there's usually a Replace; and Sudden View's no exception. Though it's not useful for locating text; Find and Replace go together like cream and sugar, so I'll cover them both in this section (that is, I'll cover both Find and Replace; you'll have to provide your own cream and sugar). Last Change As you edit text and then move to a different part of the file to do some more editing, Sudden View keeps track of the last four places you have worked. Going back to these places is as easy as selecting Last Change in the Root menu. It's a great way of finding something that you worked on earlier, and then returning to your current editing. Each of the four file buffers in Sudden View keeps it's own Last Change pointers, so if you flip to another file, and then come back to your first file, Last Change will still remember where you were working in the first file. If you move to a new place in the file, and then select Last Change, the place you started is saved, so that hitting Last Change four times will always get you back to where you started. Last Change is one of the fastest get-around keys in Sudden View. Try it, it's sort of like Dorothy and the magic shoes. Find Find and Replace are two separate features, but since Replace will not activate until you do a "Find", they both start at the "Find & Replace" entry of the root menu. You might as well use the keyboard to activate the Find operation since you will need your hands on the keyboard for entering the pattern, and the mouse is of very little use in Find & Replace anyway. At this point, the data keys are live and you can begin a partial key search. In other words, if you hit any alpha, numeric or special character key, Sudden View will immediately begin a search. As you press each data key, it will find any partial pattern which is valid to that point. The active pattern is shown in the status line and also in the text window highlighted in gold. You may only need to hit two or three characters to find what you are looking for. A partial key search can often speed up the finding process. Once you have located your text, Esc will get you back to the root menu for further editing. If you're going to do more with this pattern, maybe I should tell you about the Include functions. Since the characters in gold form a pattern that will be replaced or searched for if you do a Replace or Find Next Occurrence, it is important to define exactly the pattern you want to use or save. You will notice that the Find pattern evolves dynamically as you search. Once you have found what you are looking for, you can include the entire word or phrase in the search pattern by using the Include functions as indicated. You can include a few characters or whole words. Backspace will un-include characters from the pattern, but will not search backwards up the file. The pattern size is limited to 20 characters total. Before we get too involved in finding special patterns, let's review the Top of File feature. Since Sudden View only searches from the current cursor position down, it's sometimes handy to quickly go to the top of the file to start a new search. Selecting this menu will do it; but it also will do something else. It automatically sets up the search pattern to be reset if you enter a new pattern by hitting any data key. This is so you can start a new search if you like. If not, just hit the "Find Next Occurrence" menu as normal. The Clr/Home works the same way, but the Power Menu is generally quicker. If you want to limit your next search as you did the first one, Last Change will take you back to where that search started. Just hit Esc, Last Change and then re-enter Find & Replace to continue searching. If you are getting to many "hits" on a pattern, it might help to toggle the Case Sensitive feature and go to the Top of File to restart the search. When it is active, it will match the "case" of each pattern character exactly, otherwise, it will search for a pattern containing either upper or lower case characters. Normally, searches start on word boundaries, which is the first alpha character of any word or phrase. If you want to find a word which might be within another word, just toggle the Imbedded Search feature. If you are not finding what you are looking for, make sure that Case Sensitive and Imbedded Search are set properly. Using these two features, along with normal searches, you should be able to locate the text you want. Once a pattern is established, it can be searched for again by simply selecting "Find Next Occurrence". This is true even if you return to the root menu. Upon entering "Find & Replace" a second time, the last search will be indicated in the status line and can be re-activated; at least until you hit any data key. Pressing any data key will reset the pattern and start a new search; but don't despair, if you liked that last pattern, you can still search for it again. Just select "Search Patterns", and you will get a choice of the last seven things that you have searched for. You will see that they have been rotated into the menu. Just select the one you want. Search Patterns also can be used for markers. Just put some unique words in your file at special places (words that start with Q or Z work well). Now search for these words in turn and they will stack into the Search Patterns. Now you can use them to hop around the file any time you like. It's like dropping magic bread crumbs through your file. By the way, just like the birds, doing more Finds will eat your old bread crumbs; so you may have to re-find them to restore them to the Search Patterns menu. Speaking of Search Patterns, you might notice that the last pattern does not rotate. It is always the form feed character (the funny little double F). This special pattern is handy for finding page breaks that you might have inserted from the Filer menu. One more thing about Search Patterns: selecting a prior pattern will not restore the original conditions of the Case Sensitive and Imbedded Search toggles. I tried it that way, but it's more confusing than helpful, so always check these toggles if you have any doubt. Replace Replace always follows a Find: it will not activate if you haven't just found something. So find something, but hold on! Don't select Replace just yet. First make sure that the found pattern in gold is the complete pattern you want replaced. If you only needed a couple of keystrokes to find your pattern, you might want to finish it off using the Include function so the total word or phrase will be replaced. All right, it's time; select Replace. You will notice that two of your choices are the same as the Find menu; and they do the same thing, well, almost. Find Next Occurrence will find the next occurrence just like in the Find menu, but it keeps you in the Replace menu for immediate replacement. On the other hand, Top of File will return you to the Find menu so you can start a new search. But if you want to chicken out, you can also go back to the Find menu using Esc once. Using it twice takes you all the way back to the Root menu. If you decided to push on, you can do a Replace using the last replace pattern as shown in the status bar, or simply enter the new pattern using data keys. It works just like the Find pattern did; the old pattern is cleared and the new pattern is inserted. Don't let the cursor bother you; it's always over the last character that you have entered. This is so what you are seeing is exactly what you will get if you Esc at any point. As you are entering the pattern, you can use Backspace to correct any errors. When you have finished, hit Esc to return to the Find menu or you can use Enter or Return to indicate that the pattern is complete. If you have stayed in the Replace menu, you can still find the next occurrence by selecting Find Next Occurrence. The Replace & Find Next menu does exactly what the other two functions do, but in one keystroke. It's handy if you are doing lots of replacing. If you have the personalized version of Sudden View, you can select the Replace All menu, and Sudden View will dance down through your file replacing each occurrence until it reaches the end. If you want, Esc will stop the process; but you've got to be fast or everything will already be replaced.