File |
Edit |
View |
Search |
Run |
Debug |
Calls |
Options |
Help |
New program Open Program.. Merge.. Save Save As.. Save All Create File.. Load File.. Unload File.. Print.. DOS Shell Exit
|
Undo Cut Copy Paste Clear New SUB.. New FUNCTION..
|
SUBs... Next SUB Split Next Statement Output Screen Included File Included Lines
|
Find.. Selected Text Repeat Last Find Change.. Label..
|
Start Restart Continue Modify COMMAND$.. Make EXE File.. Make Library... Set Main Module..
|
Add Watch.. Instant Watch.. Watchpoint.. Delete Watch.. Delete All Watch Trace On History On Toggle Breakpoint Clear All Breakpoints Break on Errors Set Next Statement
|
(loaded files)
|
Display.. Set Paths.. Right Mouse.. Syntax Checking Full Menus
|
Index Contents Topic:(context-sensitive) Help on Help
|
2. Table showing all of the drop down menu options.
|
Lets look at each of the drop-down Menus in the Menu Bar.
|
File Menu
|
File. Activate it by left clicking on it with the mouse or pressing Alt+F. There are twelve menu options starting with:-
New Program. Click it. Now QBasic has opened a new document for you and you can start writing your program.
Next down is Open program.... When you click on it, a large window opens. You should be able to see 3 boxes. First one's title is File Name:. This box shows the name of the file that will be opened if you click OK. Now it should show *.BAS. The second box's title is Files. This one shows you current files in your directory that have an extension shown in File Name: box. The third one shows you directories and drives which you can browse to look for a file you want to open. There are also 3 icons at the bottom. The first one is OK. When you click this one, QBasic opens a file you selected. Cancel cancels the Open program... procedure. If you click on Help icon, you get a short help that tells you what to do with the Open Program Dialog box. Then click OK at the bottom and then Cancel because we have no files currently to open.
Now we move to Merge... icon in the File menu. This is used to insert the contents of a text file into the currently loaded file. It functions similar to Open Program Dialog, just that you now have to have a cursor positioned at the place where you want to insert a text file.
Back to File menu. Click Save. Here you save your work on Hard Disk. You simply type a name you want your file to have in the File Name: box and choose the directory where you want this file to be saved in Dirs/Drives box. You can also tell QBasic wether you want this file to be saved as QuickBASIC - Fast Load and Save which I highly recommend to improve speed of loading and saving files, or if you want this file to be saved as Text - Readable by Other Programs, which I don't recommend, unless you want to edit this file with another program later. When you click OK file is saved to the directory you specified under the name you typed. If you click Cancel you cancel the Save procedure and if you click Help you get a short help that shows you how to use Save Dialog box. Back at File menu, click on Save As.... This one is completely the same. The only difference is that when you click on Save the second time, it will NOT ask you for a file name and destination folder, but save the file under the file name and folder you already specified when you clicked it the first time.
Save As... always asks you for the name in case this time you want to save this document under a new name or another folder. Save All is also the same, but it saves all the documents you have opened. That means that if you worked on one document a little, then opened another or edited a new one, and then clicked on Save All, it will save both documents, under their old names, or will ask for a new name if not specified.
Create File... icon will create a new file. It will ask you for the new file's name and type.
Module file is .BAS file that is somehow connected with the currently opened file into one project.
Include file is a data file from which your programs inputs data, and
Document type file is simply a document and Smart Editor functions are turned off.
Now click on Load File... (in the File menu). Now this is familiar, right? Everything's the same, only that you now have to specify the type of file you are loading. Is it Module, Include or Document type.
Now click on Unload File... (in File menu). Choose module (file) you want QBasic to unload and click OK. File is now unloaded.
Now click on Print... icon in File menu. This is where you can print what you have written. You can print Selected Text only, if you check the first Option Button. If you then press the OK button, your printer will print the selected part of your program. Click here to see how to select the text in QBasic. If you check the Active Window Option Button and press OK, then your printer will print out the file you are currently viewing in the window, but without subprograms. If you select the Current Module Option Button, your printer will print the entire file you are viewing, with all the subprograms. If you select All Modules Option Button and press OK then your printer will print out all the modules you currently have opened. If you got here by mistake, you can always click on the Cancel button, or if you still don't understand what this window does, you can click on Help button.
If you select the DOS Shell icon in the File menu, then QBasic will put you in DOS mode, but will not unload itself. You can do then some other work you have to do, and then type EXIT at the command prompt to return to QBasic. If you select
Exit QBasic session ends, but it first asks you if you want to save changes to the file you have opened, if you changed anything. That's all about the File menu.
|
Edit Menu
|
Now we move on to the Edit menu. Here we have a bit fewer icons than in File menu. You can also see something like Alt+Backspace, Shift+Del and so on on the right side of the menu. These are Shortcut Keys. That means if you press these two buttons (Alt and Backspace, Shift and Delete...) while editing a specific action will happen. Now let's see what will happen.
If you select the Undo icon in Edit menu or press Alt+Backspace while editing, the last action you have done, will be undone. That means if you accidentaly deleted half of your program, then you can bring it all back by just pressing these two buttons or by two mouse clicks.
Then there is a Cut icon or Shift+Del shortcut key. This one will cut out all the selected text you have selected. But, this text is now not deleted it's just stored into memory. You can bring it back by clicking on Paste or pressing Shift+Ins. Be careful, as this will put the beginning of the stored text exactly on the place where your cursor is, so try not to have it in the middle of the line. Copy icon ot Ctrl+Ins Shortcut Key works similar to cut, it just doesent erase the text. It simply stores it into memory. Then you can again click on Paste or press Shift+Ins to put all this text into desired place. Note that you don't have to have enough room for the text you want to paste. One empty line is enough for QBasic, as it will move all the text lower than your cursor down to come after the copied text.
Then, there is this lovely Clear icon or Del Shortcut Key. This one completely deletes all the selected text and does not store it into memory. So, once you deleted it, you can't bring it back, unless you choose Undo from the Edit menu or press Alt+Backspace.
Then, there's New SUB... icon. You can click on that to create a new subprogram. Before QBasic can create a new subprogram, it must know it's name, so give it to QBasic when it asks you for it and click OK. If you change your mind, it's still not too late, because you can press Cancel, or if you don't understand something, you can press Help.
Similarly if you press the New FUNCTION... icon in the Edit menu, but then QBasic creates the new Function and not the subprogram. You will know the difference in later tutorials.
|
View Menu
|
View menu allows you to view different things in QBasic.
The first option there is SUBs... with it's shortcut key F2. Then QBasic opens a large box which contains a smaller box with Choose program item to edit title. In the box you can see all the subprograms you have, but also all functions you have. You can select one and then click on Edit in Active icon below to edit this subprogram/function in active window, or you can click Edit in Split if you want QBasic to split screen, so you can quickly edit two subprograms in your program. You can press Cancel if you want to cancel this action. There's also the Delete icon which deletes the procedure from module. If you select the title of your program and click delete, the entire program will be deleted if it's not saved. When you click on Delete icon, QBasic will ask you to confirm the deletion. You can press OK to confirm, Cancel to cancel or Help if you want QBasic to give you help on this one. If you click on Move icon, QBasic will ask you where by openning the familiar box. It will list all the .BAS files of the current directory in the box and on you is only to select a file where you want to move the procedure you selected and press OK to move, Cancel if you want to select another module, or Help if you don't understand something about this small box. You can also press Help while viewing SUBs... to get some help about that box.
Back at the View menu, we have Next SUB icon or Shift+F2 Shortcut Key. Qbasic will simply open the next subprogram you have. Subprograms are automatically sorted in alphabetical order, so you can predict what subprogram you will be in when you press Shift+F2.
Split will split your screen horizontally so you can edit two different parts of your program at the same time. To switch between the windows without mouse, you can press F6.
Next Statement icon will show you the next statement which is to be executed by QBasic. This is used when you are running your program Step-by-Step.
Output Screen or F4 Shortcut Key will display the output screen. This is the screen your program has created while running. This is useful if you're in Step-by-Step mode and if you wish to read some data your program has printed out on the screen.
Included File displays the file you included in your program so you can edit it, while..
Included Lines displays it only for viewing.
|
Search Menu
|
Now we move on to Search menu.
First icon is Find.... When you click on it, QBasic asks you Find What:. Here you type what string you want QBasic to find in current file. You can see two check boxes. The first one says Match Upper/Lowercase. If you check this, and start search, QBasic will try to match the word exactly as you typed it (it will match case). If you check Whole Word then QBasic tries to find not the letter or letters you typed (which could be contained in a word with a completely different meaning), but it will try to match the entire word.
??something skipped??
Also you have 3 Option Buttons on the right. If you select 1. Active Window QBasic will only try to find matches in current window. If you select 2. Current Module QBasic will try to find matches in subprograms and functions, and if you select 3. All Modules, QBasic will try to find matches in all modules you currently have opened. Again OK tells QBasic to start search, Cancel to end search and Help displays help on this box. Once you clicked OK, QBasic will find the first match. To find the next match, press the shortcut key F3 or..
select Repeat Last Find from the Search menu. If you choose Selected Text from the Search menu, or press Ctrl+\, then QBasic will search for the text you have selected. If you haven't selected text, then a dialog box will open asking you what text to look for, similar to when you click on Find....
Now let's move to Change... icon. You get a similar box to what we already had on Find..., but now you have Change To: prompt. Now you must type the string you want QBasic to find and in the lower box, what string to change this to. For example in Find What: I type PRINF and in Change To: I type PRINT. Again you have two check boxes and 3 option buttons, which I already explained. At the bottom, you have Find and Verify icon. If you click this, QBasic finds the string you typed and asks you if you want to change it. If you do, you click Change, if not Skip, or you click Cancel if you want to cancel the entire Change process. If you don't understand something about this box, you press Help. If you are absolutely sure you want to change every match, then you click on Change All. If you want to cancel the Change... process, you press Cancel and if you don't understand something, again you press Help.
Now select Label... from the Search menu. This one is almost the same as Find.... The difference is that this only looks for matching labels. In QBasic you can put a label in front of a code, so you know what it does. This is what Label... looks for.
|
Run Menu
|
Now we move on to Run menu. This is where you can start, restart and continue your start.
Start or Shift+F5 starts a program you wrote.
Restart restarts your program if it's already running and you stopped it. You can stop a program from working by pressing Ctrl+Break.
Continue or F5 continues a program from where you stopped it.
Modify COMMAND$.... COMMAND$ is a function in QBasic that returns the command last typed in DOS mode. Here you can modify that. For example if last command was QB Ex1.BAS, now you can modify that to QB Ex2.BAS and then test your program with that COMMAND$. Click OK to make changes, Cancel to cancel Modify COMMAND$... process or Help to receive help on this box.
Make EXE File... says it all. Now you can compile your programs into .EXE files. First if you didn't save your program, QBasic asks you if you want to. When you save it, it asks you for the name of .EXE file. Then if you check Produce Debug Code then QBasic compiles your program so that you can always end it with Ctrl+Break. You also have 2 Option Buttons. If you select EXE Requiring BRUN45.EXE then your program will need BRUN45.EXE file to run. If you check Stand-alone EXE your program will run slower, but will not need BRUN45.EXE to run. Now if you want to compile it already, then click on Make EXE to compile. Wait until it's done and then you're back at your program. You can click on Make EXE and Exit if you want QBasic to compile your program and exit to DOS mode. Then you have Cancel button and Help which you already know what they are here for.
Next icon in Run menu is Make Library.... Here you can create your own library from the currently loaded modules. First type a file name with exstension in Quick-Library File Name:. Default exstension is .QLB. If you select Produce Debug Code then execution of Make Library... will be slower, because QBasic will debug modules before it puts them in a library. You can choose Make Library to make library and stay in QBasic or Make Library and Exit to make library and exit QBasic. Press Cancel to cancel Make Library... action or Help to get more help on making libraries.
Next icon is Set Main Module.... Here you can set the main module of your project. Simply select one of the loaded files which you want to be the main module and press OK. If you want to cancel this action, press Cancel or if you need help, press Help.
|
Debug Menu
|
Now we move on to Debug menu.
The first icon is Add Watch.... This is very useful when you are writing a complicated code. It shows you the current value of a variable you entered. You can have up to 8 watches. Click on Add Watch.... QBasic now asks you for the variable name. Type it and hit OK. Watch is now added below the Menu Bar. Press Cancel to cancel the Add Watch... action, or Help to get help on this dialog box.
Next is Instand Watch... or Shift+F9 Shortcut Key. Position the cursor on a variable whose value you want to find out and press Shift+F9 or choose Instant Watch... from the Debug menu. QBasic will now show the name of the variable and it's value in the box below. You can now choose Add Watch to add this variable to watch, Cancel to cancel Instant Watch..., or Help to get help on Instant Watch....
You can add a Watchpoint... to see wether a variable has a value or is equal to zero. If it's zero, then QBasic says FALSE, and if it's other than zero, then QBasic shows TRUE. First QBasic asks you for the name of the variable. Enter it and press OK. Watchpoint is added below the Menu Bar. Press Cancel to cancel Watchpoint... action or Help to get help on this Dialog Box.
Now click on Delete Watch... to delete a single watch from our "Watch List". Select the watch you want to remove and press OK. Watch you selected is now removed from the "Watch List". Press Cancel to cancel Delete Watch... or Help to get help on this dialog box. If you have too many watches on your "Watch List", select..
Delete All Watch to delete the entire "Watch List".
Trace On, History ON and Break on Errors can be checked if you want them on. Click on one of them to check/uncheck it.
Toggle Breakpoint or F9 Shortcut Key sets a place in a program where program will break when once started. There can be multiple breakpoints.
Clear All Breakpoints clears them all. If you want to jump over a part of your program, then position a cursor on the statement you want to be executed next and choose Set Next Statement from the Debug menu. When you continue your program, it will continue from the statement you selected.
|
Calls Menu
|
Calls menu shows you all the files you currently have loaded. If you want to edit another file that is loaded, you don't have to load it again, but just click on Calls menu and the file you want to edit.
|
Options Menu
|
Now let's move to the Options menu.
The first icon says Display..., so let's click on it. Here you can edit colors you want QBasic to have. Select the colors you want to change: 1. Normal Text, 2. Current Statement or 3. Breakpoint Lines. Now you can select the foreground color (text color) from the box, as well as background color. When you are done, you can check/uncheck Scroll Bars. If this is checked, Scroll Bars will be visible, if it is not, they will be invisible. You can edit the Tab Stops number. This is the number of columns your cursor will jump over when you press the TAB key. Press OK to save changes you made, Cancel if you did something wrong or Help to get help on this Dialog Box.
Now click on Set Paths... in the Options menu. Better don't touch anything here if you're a real beginner, because QBasic may not work properly if you change anything. In the first box you can type the folder where executable files .EXE and .COM are stored. In the second box, you can type the folder where include files are stored. These are .BI and .BAS files. Next box contains the folder of library files, .LIB and .QLB. And the last box contains the folder of the help file, .HLP. Click OK to save changes, Cancel if you unintentionally changed something or Help if you need more help.
Now click on Right Mouse... icon in Options menu. You should see a simple box. You can now decide what your right mouse button should do when clicked. Will it display a Context-sensitive Help or Execute up to this line. If you choose the first option then when you click the right mouse button on a statement, help for this statement will be displayed. If you choose the second option, your right mouse button will tell QBasic to execute your program up to the line where you clicked the right mouse button. Click OK to confirm, Cancel to cancel Right Mouse... or Help if you need more help.
If you are tired of annoying QBasic interpreter that bugs you with syntax errors you make, then click on Syntax Checking to uncheck it, so QBasic won't check what you wrote. If you want it back on, click on it again.
If you think your menus are filled up too much, click on Options menu and select Full Menus to empty them a little. If you want your icons back, click on Full Menus again.
|
Help Menu
|
Finally, we reach the last menu, Help.
First icon is Index. Click on it to have QBasic display all the QBasic commands for you in alphabetical order.
Click on Contents to have QBasic display general help for you
The third line is modifiable. It depends on your cursor's position. Position the cursor on a statement and select Topic: [STATEMENT] or press F1 and QBasic will automatically show you detailed information on that statement. It's just like Right Mouse..., when you can choose your right mouse button to show Context-sensitive Help.
You can also get Help on help by selecting this from Help menu or pressing Shift+F1.
|
List of commands you learned in this tutorial
|
COMMAND
|
DESCRIPTON
|
COMMAND$
|
returns the last line typed at DOS command prompt
|
|
|
|