AMOS - The Creator User Guide - eBook-ENG

Page 30

II This system is not just limited to procedures of course. It also works equally well with Labels or line numbers. So even if you don't need procedures, you'll still find a use for this feature.

II

Folding a procedure definition If you build up your programs out of a list of frequently used procedures, your listings can easily be cluttered with the definitions of all your various library routines. Fortunately, help is at hand. With a simple call to the Fold command, you can hide away any of your procedure definitions from your listings. These routines can be used in your program as normal, but their definitions will be replaced by a single Procedure statement. Example: Position the cursor anywhere in the definition of ALERT and click on the Fold/Unfold option from the menu window. Bing! The contents of your procedure will vanish into thin air! Despite this, you can run the program with no ill effects. The only change has been in the appearance of the listing in the editor window. If you want to modify this procedure, it's easy enough to get back to the original listing. Just select Fold/Unfold again, and your procedure will be expanded to it's full glory. It's also possible to fold ALL the procedure in your program at once. This uses an option on the SEARCH menu called Close All. To bring the Search menu onto the screen, click on the button with the same name, or press F5 from the keyboard. Now select the Close All button to remove the procedure definitions from the current program. The effect on EXAMPLE 3.1 is dramatic! The entire program now fits into just asingle screen. So you can instantly see the procedures we've been using in the program. Each procedure definition can be edited individually by expanding it with the Fold/Unfoldbutton. Or you can unfold the the whole program with Open All from the search menu.

II II II II II II

Search/Replace The search/replace commands provided by the AMOS Basic editor are accessed through a special SEARCH menu which can be called up either from the menu window or by pressing function key F4.

II

Finding an item We will continue our tutorial with a brief look at of some of the Search/Replace instructions. Let's start with the FIND command. This can be executed either directly from the SEARCH menu or using the keys Cntrl+F from the keyboard. When you select this command, you will be asked to enter the search string. For an example, press Cntrl+F and type Rem at the prompt. AMOS will now search for the next Rem statement in your program, starting from the current cursor position. If the search is successful, the cursor will be placed over the requested item. The search can now be repeated from this point with the Find Next option (Cntrl+N).

Replace

II II II

Supposing we wanted to change all the Rem statements in a program with the equivalent "... characters. This could be accomplished with the Replace command. In order to use this option, it's necessary to define the replacement string. So the first time you call up replace, you will always be asked to enter this string from the keyboard.

II

18

II


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.