A QUICK GUIDE TO THE TURBO 7.0
INTEGRATED DEVELOPMENT ENVIRONMENT (IDE)

The Keyboard

Take a few moments to become familiar with the PC keyboard. Locate the large "Enter" key (sometimes this is called the "return" key) and the Escape key. There are three "helper" keys you will use: SHIFT, ALT and CTRL. Each of these keys may be held down and then another key (or keys) pushed at the same time. Such key combinations, for example, will be denoted CTRL-K or ALT-9 (hold down the CTRL key and then tap the K key, hold down the ALT key and then tap the 9 key, etc). Also note the ten (or twelve) function keys labeled F1, F2, etc. A key combination like CTRL-F10 means to hold down the CTRL key and then tap the F10 key. Such combinations are called control characters or alt characters.

The IDE Environment

The Turbo V7.0 environment is menu driven. You may make menu selections either from the keyboard or using the mouse (or both). You can determine which is best for you, and you will very likely modify which commands you use as you become more experienced. The environment presents you with the Main Screen. The main menu commands are located across the top of the screen. These commands are entry points to a larger list of subcommands made available via a pull-down menu. To activate (or open) the File Menu, for example, simply push the Alt-F keys or use the mouse to point to the word File and then click the left mouse button. Hint: you can always activate the file menu, no matter how badly things have gone for you, by first pressing the Escape Key and then the F10 and F keys! You close the File menu by either pushing the F10 key or clicking off the menu with the mouse. Important: the Escape key has been designed so that it will close any open window. The HELP menu is available from the Main Screen by pushing the H key. Practice getting help on topics from time to time--it's quick and easy! Many often-used commands have hot key shortcuts (for example CTRL-F9 runs a program); some of these may be worth using because they are efficient. In general, however, finding a command using the menu system is clearer and easier, but usually takes a little longer. Let your own experience be your guide! Commands, once found, can be executed from their menus by either pushing the single letter highlighted in red in the commands, clicking on the command with the left mouse button, or using the arrow keys to move the "big highlight" bar to the command you wish to use and then pressing the Enter key.

The Turbo Editor

The Editor is the tool you use to create a Pascal program. When you enter the Turbo IDE, you will see an editing window open labeled NONAME00.PAS. This default name can be changed by using the SAVE AS command in the FILE menu. A dialogue box will open, giving you an opportunity to change the name of the file. When you first create a program file, you should be sure that your default drive is drive A: (use the CHANGE DIR command of the FILE menu). Then save your file very soon using a meaningful program file name (these will be suggested to you in the programming assignments). When you type your program, you will notice that certain editing commands help you correct mistakes: the DEL key will erase a character on which the cursor is located (the cursor is the short blinking character on the screen which indicates your place on the editing window). The backspace key will erase a character to the left of the cursor. You may use the mouse to shade a section of text using "drag and drop" (place the mouse cursor on the first character of the section you wish to erase, push the left mouse button and while pushing the button, drag the mouse over the text you wish to delete. Release the left mouse button; see the text shaded. Use the CUT command of the EDIT menu. Notice that the PASTE command is available after a CUT operation, which allows you to reinsert the text somewhere else in the program document (this is the classic "cut and paste" operation available in all major word processors which support the windows environment.) You should also take note that certain key words appear highlighted automatically in the Turbo Editor; this helps you keep track of Pascal reserved words as you type your program.

Saving your program

When you are typing in your program, it is saved in the computer's main memory and no copy of it is placed in secondary storage (on diskette) until you tell the computer to do so. Thus it is essential that you develop the habit of saving your program on diskette several times an hour while typing your program (once every ten minutes seems to be about right). Then in case of catastrophe, you need only retype the last few minutes worth of work (not an entire evening's!). Use the SAVE AS command of the FILE menu to place a copy of your program on diskette with a name of your choice. If the file name is the way you want it to be, use the SAVE command instead. Because of errors which can appear in the compile and run phases of your program development, ALWAYS SAVE A COPY OF YOUR PROGRAM BEFORE PROCEEDING TO THE NEXT STEP!!

Compiling and Running your program

The compilation phase of developing your program is accomplished by using the COMPILE command on the COMPILE menu (use ALT-C to activate the COMPILE menu and C to launch the compile command). The "hot key" is simply ALT-F9 which you can press while still in the Editor (thus bypassing the menu system altogether). During compilation, errors which are found are flagged with an error message, the offending portion of the program is highlighted and the cursor stops near the area where the error occurred. Notice that the Turbo compiler stops at the FIRST occurrence of an error, rather than scanning the entire program for errors. There is a certain intelligence in this approach, since compiler errors have a way of "cascading" (early errors fool the compiler into thinking that later code is in error when in fact it is not). Your job during compilation is to correct errors detected by the compiler (called "syntax errors," or "compile time errors" since they are discovered at the time when your code is compiled). After the compilation phase is complete and error-free, first save your program. Then you can run it. Use the RUN command from the RUN menu (the hot key shortcut is CTRL-F9). The output of a typical program is sent to a special screen called the USER SCREEN. If you run a program and you cannot seem to locate the output, then it most likely is on your user screen which can be brought to the foreground by using the hot key ALT-F5 (touching a mouse button or the spacebar will bring you back to the editing screen).

Some of the most troublesome errors programmers encounter occur when a program is run (called "run time errors"). Typical difficulties include (1) output is not what was expected, (2) program seems to run correctly but produces no output or (3) program runs erratically or causes the computer to "hang" in an error condition. Error type (3) can cause serious problems since the computer may have to be shut down and restarted if the error causes a major computer memory error. For this reason especially, NEVER ATTEMPT TO RUN A PROGRAM WITHOUT FIRST SAVING IT! Form the strict habit to observe the rule: first SAVE, next COMPILE, then RUN. And BACKUP, BACKUP, BACKUP!!!

Leaving the Turbo Environment

When you have finished working on your program, you leave the Turbo IDE by using the hot key ALT-X (or use the EXIT command in the FILE menu). If you have not recently saved your program, you will be prompted to do so before exiting.


Back to: [Home Page]