Please enable JavaScript to view this site.

A-Shell Programmer’s Notepad

Navigation: Usage

Navigating and Viewing Programs

Scroll Prev Top Next More

Basic navigation within a single program file should be fairly intuitive if you’ve ever used any other Windows based editors. Such users can browse through the following material very quickly (although the first couple of tips about opening ++include files are worth a moment of attention). For those used to editing with VUE the following will give you quick intro into how a modern GUI editor can make your life much easier, without having to spend a lot of time mastering arcana.

To start with, let’s open up a project group. If you don’t have APN set to auto save/restore the workspace, you can find the previous project group in the Files > Recent Projects list or by just browsing to the projects directory where you stored it. From the list of programs you can then double-click one of them to open it. For example:

apn1_img18

Now let’s open one of the include files, fnswitches.bsi. Depending on whether we added the sosfunc: directory to our project, we might be able to locate it easily in the projects window. But even easier would be to click on the line and then enter Ctrl+Shift+o …

apn1_img19

and the specified file is opened and added to the tab list (if not already open):

apn1_img20

Now you can just click between the two program files by clicking the tab label.

If the program doesn’t have too many ++include files, you might want to just open them all in one step, using Ctrl+Shift+P (doesn’t matter where the cursor is as long as the current file is a main program and not itself an include file). So we go from this:

apn1_img21

to this:

apn1_img22

with Ctrl+Shift+P.

Once you have the entire program (all the ++include files) open, its easy to search it for, say, all the references to a particular function. If we are looking at the function Fn’Get’Switches() and want to locate all the places it is called, we can highlight it with the mouse or keyboard, hit Ctrl+F, and then click on the Find in Files tab and select the Open Files option:

apn1_img23

The results appear in a new Find Results panel…

apn1_img24

You can then double-click any of the entries in the list to jump to it.

When working between two parts of a single file, such as a function body and a call to that function, it is sometimes useful to be able to see both at the same time. To do this, use the Window > Split option, which opens two windows into the current file:

apn1_img25

Both windows are showing the same file, but as you can see from the line numbers along the left, there is a gap of about 300 lines between the two windows.

To go back to the normal view, use Windows > Close View.

To do a similar thing with two different files, use Window > Tile

apn1_img26

You may have noticed that when you select a string, it automatically highlights other occurrences of the same string visible in the window:

apn1_img27

This optional feature is intended to help you visually identify other references to the same variable, since failure to notice one or more of them is a common cause of bugs. Especially when dealing with code like in the example above where there are many occurrences which are partly obscured by all of the punctuation, not to mention the visual similarity between SW(1) (not highlighted) and SW(I) (highlighted). If you don’t like the feature, you can turn it in Tools > Options:

apn1_img28