Thank you for using our Mac software portal. Unfortunately, there is no direct download for the Mac version of QuickRes. To download the product, proceed to the developer's site via the link below. FDMLib cannot ensure the security of software that is hosted on third-party sites.
The following topics are discussed in this section:
GENERAL INFORMATION
Microsoft QuickBASIC, version 4.5, is a fully integratedpackage that contains an editor, a compiler, a linker, and adebugger. You can create programs that run by themselves or withthe help of the BASIC run-time library module.
GETTING STARTED
The QuickBASIC package comes with two programs. The firstprogram is the compiler, which creates an executable file fromyour BASIC source code. To compile and link your source code, usethe MSB command followed by your filename and then pressthe [ENTER] key.
You can also create executables from the integratedenvironment. To run the environment, issue the command QBand press [ENTER] . To edit a specific file, specify the filenameafter the QB command and before you press [ENTER] . Theenvironment works well with a mouse, so the LAN willautomatically load the mouse driver (if it is not already loaded)before placing you in the editor.
USING QUICK BASIC
When you first execute the environment, you will be placed inthe editor. At the top of the editor is the main menu. The linebelow this contains the name of the file currently being edited.If the file has no name, the word Untitled will appear. Onthe far right of this line will be an arrow. If the arrow onlypoints up, it means the editor does not fill up the entirescreen. To expand the editor window, place the mouse cursor onthe arrow and [Left Mouse Button] . When the arrow points in boththe up and down directions, it means the editing window occupiesthe entire editing area. Clicking the [Left Mouse Button] on thisarrow will cause the window to reduce to its size before thewindow was expanded.
At the bottom of the screen is a reference bar. This linecontains information such as which key displays help, informationabout the currently selected menu option, the status of the CAPSLOCK and NUM LOCK keys, and the current column and row positionof the cursor.
Above this reference bar is the immediate window. This windowis used to test your programs and perform calculations. Youcannot, however, load files into this window.
Each window will have scroll bars at the bottom and right ofits borders. The scroll bars can be used to display where you arein the file displayed as well as move to a specific locationwithin the file. Your position in the file is denoted by theposition of the black box on the specific scroll bar. If theblack box is half-way between the ends of the scroll bar, thenyou are currently viewing the middle of the document. To move toanother area of the file, place the mouse cursor on the desiredside of the black box and press the [Left Mouse Button] . If thecursor is below the black box, the window moves down one page inthe file. If you click above the black box, the editor moves thedisplayed text up one page. The same method can be used to withthe horizontal scroll bar to move right and left in the document.
Using the Menus
The main menu is located on the top line of the screen. Thereare several ways of selecting an option from the main menu. Thefirst, and easiest, is to place the mouse cursor on the desiredoption and click the left mouse button. A submenu will appearfrom which you can select the desired option. Another approach isto hold down the [ALT] key and press the capitalized letter ofthe desired menu option. The third method of selecting a commandfrom the main menu is to press the [ALT] key and then use thearrow keys to highlight the desired option. Pressing the [ENTER]key while the option is highlighted will cause that command to beexecuted.
If you decide you want a main menu command other than the oneyou have currently selected, use the [Left Arrow] and [RightArrow] keys to choose the new option. Another method is to placethe mouse cursor on the new option and press [Left Mouse Button].
Keyboard shortcuts are displayed next to certain options insubmenus. These shortcuts specify the keyboard equivalent for thespecific submenu option. To specify the option, press thespecified keyboard combination.
Using the On-line Help
There are several ways to display the on-line help. The firstis to highlight the command for which you are requesting help,and press the [F1] key. You can also select the Help menuoption, and the menu will present four options.
The Index option displays an alphabetical list of allthe keywords in QuickBASIC. You can get help on a specifiedkeyword by placing the cursor on the specified keyword andclicking the [Left Mouse Button] . The Contents optiondisplays a list of categories from which you can select forfurther help. The Topic option displays help for thekeyword located under the cursor in the edit window. If thecursor is not on a word, this option will be unavailable. The Helpon Help option explains how to use the on-line help facility.
When a topic is displayed, a menu will appear at the top ofthe help window. You can select any of the menu commands byplacing the cursor on the desired command and pressing the [LeftMouse Button] . At the end of the help information will be a listof related keywords. You can display help on any of thesekeywords by selecting it with the mouse or using the [TAB] key.
To exit help, press the [ESC] key. This will remove the helpwindow and place the cursor back in the editing window.
Help is also available for symbols in your own program. Forexample, if you wanted to see what type a variable was, you couldplace the text cursor on the variable and press [F1] .
QuickBASIC provides the ability to print the on-line help to aprinter. To do this, choose the File | Print command fromthe main menu while the Help window is the active window. Whenyou choose this command, a dialog box of options will appear. TheSelected Text option will print only that text which isselected. The Active Window option will print the contentsof the active window. The Current Module option will printthe contents of the window you are currently viewing. The AllModules option will print the contents of all the programsloaded in memory.
Many of the commands listed in the on-line help come withsample programming code. QuickBASIC lets you copy this code fromthe Help window to your program. To do this, display the desiredsample code in the Help window. You can then use the cut andpaste facilities mentioned later in this manual to copy theselected text from the Help window to your program.
Using Dialog Boxes
Dialog boxes appear whenever you choose a menu command that isfollowed by three dots. They are used to get information from youso that the specific command can be executed. Dialog boxes aresplit into several boxes. The first type of box is a text box,you use to get a string you type on the keyboard. The List boxdisplays a list of choices from which you are to select. Thecommand buttons are usually displayed at the bottom of the dialogbox. Buttons can be activated by placing the cursor on them andthen pressing [ENTER] or [Left Mouse Button] . Option buttonswill display a small dot if the option is active. Check boxeswill display an 'X' if the option is selected.
Quitting QuickBASIC
The option to quit QuickBASIC can be found in the Filemenu. To exit, choose the File and then the Exitmenu options (File | Exit). If any changes were made toyour program since the last save, QuickBASIC will ask if you wishto save the file now. To save the file, press [ENTER] . You willbe asked to name the file if this is your first time saving thefile.
Manipulating Windows
QuickBASIC has four window types in the environment. The firsttype is the View window. The View window is where most of yourprogramming is done. The Immediate window is the second type, andis used to test a line of code or do calculations. The Helpwindow appears when on-line help is requested. The fourth windowis called the Watch window, and is where the values of specifiedvariables are displayed while you are debugging your program.
QuickBASIC only lets you use one window at a given time, eventhough more than one may be displayed on the screen. The windowin which you are currently working is called the active window.The active window is differentiated by having its titlehighlighted. To make another window the active window, press the[F6] key. This will cycle through all the windows opened inQuickBASIC. To cycle backwards through the list, press[SHIFT][F6] . If you are using a mouse, you can make a windowactive by placing the mouse cursor within the window boundariesand clicking the [Left Mouse Button] .
QuickBASIC provides several means of configuring the windowson your screen. To increase the size of the window so that it isdisplayed on the entire screen, press [CTRL][F10] . To reduce thewindow back to its original size, you can press [CTRL][F10]again. To expand a window by only a few lines, press the [ALT][+] key combination for each line you want added. You can reducethe size of a window by one line by pressing the [ALT] [-] keycombination. The [+] and [-] represent the plus and minus keys onthe numeric keypad. These functions require that the Num Lockmust not be set.
It is also possible to configure the size of the window byusing the mouse. To change the size of the window, place themouse cursor on the title bar of the window you wish to change.While pressing the [Left Mouse Button] drag the border to thedesired location on the screen. When you release the button, thewindow will be resized.
The View Window
When you load a program from disk or start a new program, thesource code will appear in the view window. The view window willhave two cursors tracking your position. The first is the textcursor which shows the position where any input from the keyboardwill be entered. The second cursor is the mouse cursor. It isused to choose commands, display help on the selected word,manipulate the text window, and place the text cursor at aspecific location.
The text cursor can be moved by typing text or using thedirection keys. The [Left Arrow] , [Right Arrow] , [Up Arrow] ,and [Down Arrow] keys can be used to move the text cursor onecharacter to the left, right, up, or down respectively. The[Home] and [End] keys can be used to move the cursor to thebeginning or end of a line respectively. If the program is largerthan the window, the [PG UP] and [PG DN] keys can be used to moveup and down one screen within the program. Pressing [CTRL] withthe [Left Arrow] or [Right Arrow] keys will move the cursor tothe beginning of the previous or next word. [CTRL] used with the[Home] and [End] keys will move the cursor to the first or lastline displayed on the screen. When used with [PG UP] and [PG DN], the [CTRL] key moves the cursor to the right or left by onescreen.
The Immediate Window
The Immediate window is displayed at the bottom of the screen.Commands in this window will be executed when you place thecursor on the command and press [ENTER] . You can put more thanone statement on a line by separating them with the ':'character. This is useful for testing lines of code beforeplacing them in your program.
The Watch Window
The Watch window is used to display the values of specifiedvariables. This lets you watch the values stored in yourvariables while you step through your program. Since one of themajor reason for program failures is an incorrect value in avariable, this is a useful debugging tool.
You can tell QuickBASIC which variables to watch by issuingthe Debug | Add Watch command from the main menu. Youshould then enter the name of the variable to watch. QuickBASICwill then display the program name, variable name, and its valuein the Watch window (located above the View window). To remove avariable from the Watch window, choose the Debug | DeleteWatch command.
The Help Window
The Help window is displayed whenever the on-line helpfacility is requested. This can be done by choosing the Helpcommand from the main menu, or pressing [F1] . In either case,QuickBASIC will display the on-line help associated with the wordunder the cursor.
The help window is split into two parts. The section at thebottom of the window is called the QuickSCREEN and contains therequested information about the command. The top of the windowcontains items called hyperlinks. Hyperlinks are connections toanother entry in the on-line help system. Hyperlinks will betopics related to the one you are currently viewing. To activatea hyperlink, place the mouse cursor on the desired topic andclick the [Left Mouse Button] . You can also use the [TAB] key tomove the text cursor to the desired topic and hit [ENTER] .Pressing [ALT] [F1] will return you to the previous topic beforeyou activated the hyperlink connection. QuickBASIC, however, onlyremembers the last twenty hyperlinks, so you cannot back up morethan twenty connections. Pressing [ESC] will close the Helpwindow, no matter how deep you are in the hyperlinks.
Copying and Pasting Blocks of Text
QuickBASIC lets you select a block of text so you can performan operation on it. You can select a block of text by placing thetext cursor at the beginning of the text to be selected, and thenhold down the [SHIFT] key while pressing the arrow keys.QuickBASIC will automatically highlight the text as you move thecursor. You can perform the same operation with the mouse byplacing the mouse cursor at the beginning of the text to beselected. While holding down the [Left Mouse Button] , move themouse cursor to the end of the block. QuickBASIC willautomatically highlight the text as you move the mouse. You canremove the highlight by pressing one of the arrow keys orclicking the [Left Mouse Button] .
Pressing the [DEL] will delete the text permanently from thefile. To move the selected text from one position to anotherwithin the file, press [SHIFT][DEL] . This places the selectedtext on an electronic clipboard. You can then press[SHIFT][Insert] to move the selected text from the clipboard tothe current text cursor's position. Each time you push[SHIFT][Insert], the contents of the clipboard will be pastedinto the program. To copy the selected block, press[CTRL][Insert] to copy the block to the clipboard. You can thenpress [SHIFT][Insert] to paste the clipboard's contents in thefile at the text cursor's position. Text placed on the clipboardremains there until a new selection is placed onto the clipboard.
You can also replace a block of selected text. To do this,first select the block of text to be replaced. Next, type the newtext to replace the selected region. As soon as you press a key,QuickBASIC will automatically delete the selected text andinsert, at its position, the new text you are entering from thekeyboard.
Opening and Starting a New File
To start a new program, issue the File | New Programcommand. If a program is currently loaded in the View window,QuickBASIC will ask if you wish to save your changes beforeclearing it from memory.
The Create File command is used to create a new filethat is part of the current program in memory. This is useful formaking separate libraries or modules. When this command ischosen, a dialog box will appear. In this box, you must specifythe name of the file to create and tell what its file type willbe. A module is a collection of BASIC commands. An include fileis a text file whose contents are placed in your program afterthe $INCLUDE metacommand is found. A document file is a simpleASCII text file.
The File | Open Program menu command is used to load apreviously saved program into the View window. QuickBASIC canopen files saved in either ASCII or QuickBASIC formats. When thiscommand is issued, a dialog box will appear where you can choosethe file to open. To select a file, place the mouse cursor on thedesired file name and double click the [Left Mouse Button] .Changing the file pattern in the File Name box will changethe files displayed in the Files window. If the file toload is on a drive or subdirectory other than the current one,place the mouse cursor on the desired drive letter in the Dirs/Drivesbox and double click the [Left Mouse Button] .
The Load File command loads the specified singlemodule, include, or document file into memory. You can specifythe name of the file and its type in the dialog box that isdisplayed when you choose this command. Once a file has beenloaded into memory, you cannot reload it until you chose the UnloadFile command to remove the file from memory.
The Merge command can be used to place the contents ofone file into another. Issuing this command will cause a dialogbox to be displayed. From this box, you should choose the fileyou wish to load. When you hit [ENTER] after typing the filename, the contents of the file will be placed at the current textcursor location in your current program.
Saving Your Program
There are several ways to save your program to a disk. Thepreferred method is by issuing the File | Save command.This command will save your file to the disk in a QuickBASICformat. If the file has not been saved previously, a dialog boxwill appear asking for a name for the file. If the file alreadyexists, the old version will be deleted and the new version savedin its place.
The Save As command is used to save the program under adifferent file name. When this command is issued, a dialog boxappears. In this box, enter the new name for the file and press[ENTER] . QuickBASIC will then save the file under the new nameand in a QuickBASIC format. If you wish to save the file in anASCII text format, place the mouse cursor on the Textoption and click the [Left Mouse Button] . Files saved in thisformat are readable by other programs such as text editors andBASIC interpreters (such as BASICA).
The Save All command is used to save all files that areloaded into memory. This is useful for saving changes to modulesand include files that can be loaded into memory with your mainprogram. This command will automatically replace any old versionsof the files when it saves them.
Printing Your Program
QuickBASIC provides a facility for printing your programs. Toprint your program, all files loaded, or a section thereof, usethe File | Print command. When this command is issued, adialog box will appear. From this box, you can specify whichitems are to be sent to the printer. If you choose the SelectedText option, all text that is currently selected in theactive window will be sent to the printer. The Active Windowoption will send all text in the active window to the printer.The printer will receive the program in the current window whenyou choose the Current Module option. To print the entireprogram and all its loaded subprograms, choose the All Modulesoption. After selecting the desired group to print, click the[Left Mouse Button] on the < OK > button or press[ENTER] to have the text sent to the printer.
The View Menu
The View menu contains options for displaying various programcomponents as well as moving files in and out of the View windowso they can be edited. One of the more useful views is that ofyour program's output. To see the output screen, press [F4] . Toreturn to your program, press the [ESC] key. The View | NextStatement option will move the cursor to the next source lineto be executed. The Split option is used to divide theView window horizontally.
The first two options in the View menu provide support forsubroutines. Pressing [F2] will display a dialog box of all theloaded modules and subroutines. To edit one of these routines,place the mouse cursor on its name and click the [Left MouseButton] . To display the file in the View window, click the [LeftMouse Button] on the Edit in Active option. Clicking the[Left Mouse Button] on the Edit in Split option will splitthe View window horizontally and place the selected file in thenew split window. The Move option will display a dialogbox from which you are to select the destination module to movethe originally selected procedure. In the list, QuickBASIC willplace module names in all capital letters and procedures will beindented below their respective module and only have their firstcharacter capitalized. Pressing [SHIFT][F2] will display the nextalphabetical procedure in the View window.
QuickBASIC also provides facilities for viewing and editinginclude files with the last two commands in the View window. Withthe text cursor on a line that includes a $INCLUDEstatement, choosing the Included File command will placethe include file in the View window. The Included Linescommand is a toggle that allows or disallows the editing of theinclude files. When this option is on, a dot will appear to theleft of the command in the View menu and you will not beallowed to edit the file. To edit, press the [ENTER] key twice.
Searching and Replacing Text
QuickBASIC provides a sophisticated search and replacemechanism. To search for a particular string, bring up the searchprompt by pressing [ALT] [S] [F] . You will then be asked for thestring to find. Enter the string and press [ENTER] . QuickBASICwill highlight the next occurrence of the specified string.Pressing [F3] will highlight the next occurrence in the file.When the end of the file is reached, QuickBASIC automaticallycontinues the search at the beginning of the file.
Replacing text works in a similar manner to searching fortext. To replace text, press [ALT] [S] [C] to display the textchange query box. In the query box, enter the string to bereplaced. Then, press the [TAB] key and enter the string to beused to replace the old text. After both fields have beenentered, press the [ENTER] key. QuickBASIC will then search forthe specified string and highlight it when found. QuickBASIC willthen ask if you wish to change the current finding. If you do,press the [ENTER] key. QuickBASIC will then continue the search,prompting you with each find if you wish to change the text.
QuickBASIC provides many options for search and replaceoperations. When you first request a search, two options willappear to the left of the dialog box. If you click the [LeftMouse Button] on the Match Upper/Lowercase option,QuickBASIC will only highlight those strings that match the exactcase of the search string you entered. The Whole Wordoption forces QuickBASIC to match the string only if it is acomplete word, i.e. not part of another word. The Searchbox lets you specify which windows will be searched. The ActiveWindow option will force a search in the active window only,no matter what window you are currently in. The Current Moduleoption will search only the current file in the View window. The AllModules option will search all programs loaded in memory.
When performing a change operation, you also have severalchoices. At the bottom of the query box will be some options tocontrol the change. The Find and Verify option will findeach occurrence and prompt you before making the change. This isthe default option when you press [ENTER] . The Change Alloption will automatically find all the occurrences of the searchstring and replace them with the change string. When the firstchoice is found and you specified the Find and Verifyoption, you will be asked if you wish to make the change. At thebottom of this window will be a list of options. The Changeoption will make the change and continue the search. The Skipoption will skip this occurrence and search for the next one. TheCancel option will terminate the search operation.
Another search option is the Search | Label command.This menu command lets you search your program for a specificlabel. When you enter the label name and press [ENTER] ,QuickBASIC will highlight the label and move the text cursor tothe label's location in the program.
Using the Smart Editor
QuickBASIC's editor provides a special feature called the'smart editor.' Every time a new line is entered intothe editor, the smart editor checks the line for syntax errors,formats the line as necessary, and compiles the source line inmemory. The smart editor is turned on by default. To disable thesmart editor so you can type a document or data file, select the documentoption after issuing a File | Create File or a File |Load File command.
When the line entered contains an error, the smart editor willdisplay an error message. Pressing [ESC] will clear the messageand place the cursor on the location within the line where theerror occurred. Your program will not run until all syntax errorsare corrected. The smart editor will not flag a misspelledcommand as an error, because it assumes you are defining a newsubroutine.
After pressing [ENTER] on a line with no syntax errors, thesmart editor will automatically convert all BASIC keywords touppercase. It also matches the capitalization of variables youhave previously defined or used. It will insert spaces before andafter all the BASIC operators and adds punctuation in placeswhere you forgot to place it.
Running a Program
After the program has been entered, you can try to execute it.To run your program, press [SHIFT][F5] or choose the Run |Start command from the main menu. If no errors exist in theprogram, QuickBASIC will automatically start executing yourprogram. If an error exists, QuickBASIC will display a messagedescribing the error and will highlight the error in the program.If more than one error exists, you must correct the first errorand try to run the program again for QuickBASIC to show you theerror. The Run | Restart command clears all variables andexecutes the program. This is useful if you wish to execute theprogram from the beginning instead of continuing from the currentlocation. The Continue option will continue executing theprogram from the last point of execution.
By default, QuickBASIC does not create an executable file. Youcan create one, however, by choosing the File | Make EXE Filecommand. This will display a dialog box where options can be set.The first, is the name of the executable file. By default, itwill be the same name as the main module. Checking the ProduceDebug Code will place special debugging information for usewith Microsoft Code View in the executable file. This option alsoenables the [CTRL][Break] sequence during execution. The defaultexecutable file requires the use of the BRUN45.EXE file inthe computer's search path to run. To create an independentexecutable file, click the [Left Mouse Button] on the Stand-AloneEXE File option. After setting the desired options, click the[Left Mouse Button] on the Make EXE or the Make EXE andExit option.
Debugging a Program
Sometimes your program will run without QuickBASIC sayingthere are errors, but it does not run properly. To help you findthese 'run-time' errors, QuickBASIC provides somedebugging tools. The first is the [F7] key. When you press thiskey, QuickBASIC runs your program up to the line that containsthe text cursor. Pressing the [F8] key will execute the next lineof code in your program. This is useful for stepping through yourprogram one line at a time when trying to find an error. If thenext line is a procedure call, [F8] will step through theprocedure. The [F10] works in a similar manner to the [F8] keyexcept it executes procedure calls as if they were one statement.
To specify certain lines where you wish execution to stop, youcan place a break point. A break point tells QuickBASIC to stopexecuting the program so you can examine your variables. Pressing[F9] will place a break point on the current line. To signify abreak point, QuickBASIC will change the color of the line in yourprogram. To run your program up until the break point, press[SHIFT][F5] . If you press [F9] on a line that already contains abreakpoint, QuickBASIC will remove it. You can also choose the Debug| Clear all Breakpoints menu command to clear all breakpointsthroughout the program.
QuickBASIC provides another form of break point called awatchpoint. A watchpoint specifies a certain condition thatcauses program execution to stop so you can examine the values ofyour variables. A watchpoint is set by using the Debug |Watchpoint command. Enter the condition and press [ENTER] .The condition will be placed in the watch window and followed byeither < FALSE> or < TRUE> dependingupon the result of the condition. When you run the program,QuickBASIC will stop execution of the program when the conditionbecomes TRUE.
Most run-time errors occur because a variable has an incorrectvalue. To watch the values of certain variables, you can specifya watch. To do this, choose the Debug | Add Watch commandfrom the main menu. QuickBASIC will then ask for the variable youwish to watch. Enter the variable name and then press [ENTER] .QuickBASIC will display the variable's name and value in theWatch window. To remove a watch from the Watch window, choose theDebug | Delete Watch command. QuickBASIC will display alist of all the watch variables. Use the arrow keys to highlightthe watch to delete and press [ENTER] . Choosing the Debug |Delete All Watch command will remove all watches from theWatch window.
The Debug menu command has a few other options for debuggingyour program. The Trace On option steps through yourprogram in slow motion, highlighting the line being executed asit runs. The Set Next Statement option will highlight thenext command in your program to be executed. The Break OnErrors option will stop execution when an ON ERRORstatement is invoked.
Another option in the Debug menu is the History Onoption. This option will record the last twenty lines of yourprogram that were executed, so you can trace back the laststatements executed before QuickBASIC terminated execution with arun-time error. You can step backwards through this list ofcommands by pressing [SHIFT][F8] . You can step forward throughthe history list by pressing [SHIFT][F10] .
Pressing [SHIFT][F9] will bring up the Instant Watch dialogbox. This box lets you enter a variable whose value you wish toexamine. When the dialog box is displayed, you are asked for theexpression to evaluate. When you hit [ENTER] , QuickBASIC willdisplay the value in the Value box. Clicking [Left MouseButton] on the Add Watch button will add the variable tothose in the Watch window.
The Calls menu command displays the calling sequence ofprocedures within your program. This is useful for finding thecalling sequence of nested procedure calls when a programcrashes. The current procedure will be listed at the top, and theoldest at the bottom. The entry at the bottom of the call stackwill be your main program.
It is also possible to use BASIC commands for debugging.Commands such as STOP, PRINT, CONT, TRON,and TROFF are useful for tracing the flow of a program.
Function Key Definitions
The following table gives a brief description of the functionsassigned to the specified function key combinations.
Converting BASICA Programs
QuickBASIC accepts most programs written in DOS's BASICA andGW-BASIC. To load a program written with DOS BASIC intoQuickBASIC, you must have DOS BASIC save the file with the ,Aoption. This saves the file as an ASCII file so that QuickBASICcan load the file into memory. If the ,A option is notspecified, the file is saved in a compressed format and will beunreadable by QuickBASIC.
QuickBASIC does not support all the commands available in DOSBASIC. Commands that interface a cassette player and editing ofthe source program are not permitted since cassette players areno longer used with PCs and QuickBASIC provides its own editor.These commands are not supported: AUTO, CONT, DEF USR, DELETE,EDIT, LIST, LLIST, LOAD, MERGE, MOTOR, NEW, RENUM, SAVE, and USR.The following statements are supported in QuickBASIC but requiremodifications: BLOAD, BSAVE, CALL, CHAIN, COMMON, DEFtype,DIM, DRAW, PLAY, RESUME, and RUN. For details on thesemodifications see the on-line help or the Microsoft QuickBASICReference Manual.
Compiling and Linking From DOS
QuickBASIC also provides programs that let you createexecutable files from the DOS prompt. This lets you use yourfavorite text editor to create the programs.
After saving your program with the text editor, you mustcompile and link it to create an executable file. To do this,enter the command
MSB filename
where filename is the name of your source file. Press[ENTER] to accept the default object file name. If you wish tohave a listing file produced, enter the name of your programfollowed by [ENTER] . Pressing [ENTER] will tell QuickBASIC notto create a listing file. If no errors exist in the source code,it will automatically run the linker to convert the object codeto an executable file. If errors are found, they will bedisplayed on the screen along with the corresponding line number.You can also use the listing file (if you requested one becreated) to help find the errors.
When the linker is run, it will first ask you for the name ofthe executable file. To choose the same name as the source code,hit [ENTER] . Next, it will ask for the name of the map file. Ifyou are not producing debug information in the executable, hit[ENTER] to specify that no map file is to be produced. The nextquestion asked by the linker is for any libraries used by theprogram. If your program uses any libraries, enter theirfilenames here. To make a stand-alone executable, enter thelibrary name BCOM45. If you do not specify this library,the executable will not run without the use of the Microsoftrun-time library executable.
HELPFUL HINTS
When dealing with long programs, it is helpful to useplacemakers to mark specific locations in your program. To mark aline, place the text cursor on the line and press [CTRL][K]followed by a place number. To go to that placemark, hit[CTRL][Q] followed by the desired place number.
When working on machines with math coprocessors, it is bestnot to place calculations within a condition. In thesesituations, the result of the calculation is stored in the mathcoprocessor's registers and may be more accurate than thecomparison allows.
QUESTIONS/ANSWERS
Q. Can I still use line numbers in my BASIC programswith QuickBASIC?
A. Yes, QuickBASIC allows, but does not require the useof line numbers.
REFERENCES/MANUALS
For a complete list of QuickBASIC commands and options, pleasesee the Microsoft QuickBASIC manual.
Your local bookstore should have third party reference manualson programming in Microsoft QuickBASIC.
EXAMPLES
(c) Copyright UCF Computer Services I& R Support08/25/93
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |