home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
c
/
compile.zip
/
COMPILE.DOC
< prev
next >
Wrap
Text File
|
1992-08-26
|
34KB
|
872 lines
QuickCompile v1.0 c1992
An Automated Make Utility
For QuickBASIC!
From:
Thomas Software
1375 Beasley Rd.
Jackson, MS 39206
Fast and Easy Compiling and Linking !
QuickCompile is an easy to use, automated Make Utility for MicroSoft's
QuickBASIC. Additional support for Crescent Software's PDQ replacement
link library is built in too.
QuickCompile is very user friendly. Familiar QuickBasic style dialog and
check boxes, online help, and full mouse support insulate the programmer
from the complicated procedure of compiling and linking on the DOS command
line.
Features
* Easy One Time Input
Once the user selects the necessary parameters for BC and Link,
that information is written to the top of the source file as a
header. QuickCompile will then read this header each time,
not requiring further user input.
* Automatic Source Search For Defaults
QuickCompile searches all modules and include files of your source
code and determines many switches and parameters automatically.
* Detailed Help System
Instant on-line help is available for all BC and LINK option by
pressing F1 or clicking an item with the right mouse button.
* Easy Parameter Editing
BC and Link parameters are stored at the top of the source file
and may be edited with QuickCompile, the QuickBASIC editor, or any
text editor.
* Fast, Skips Unnecessary Steps
QuickCompile skips unnecessary steps when compiling and linking.
Source is not recompiled when an up to date .OBJ file exists.
* Full Mouse Support
QuickCompile's QuickBASIC style dialog and text boxes fully
support MicroSoft Compatible mouses for easy input.
Section I
QuickCompile Users Manual
Table of Contents
Introduction ........................................ 1
Features ............................................ 1
Contents ............................................ 2
Why Leave The QB Environment To Make EXE Files ...... 3
Quick Start Instructions ............................ 4
How It Works ........................................ 5
Subsequent Benefits.................................. 6
Invoking From The Command Line ...................... 6
Modifying A File's Header ........................... 6
Header Layout ....................................... 7
Important Information & Additions ................... 8
NOCOM.OBJ (No Communications Routines) .............. 9
NOEM.OBJ (No Floating Point Emulation) .............. 9
SMALLERR.OBJ (No Error Messages) ................... 10
OPTIONAL UTILITIES
EXISTS.BAS Module (Check for existance of a file) 10
CHK4QC .......................................... 11
80X ............................................. 12
FILETIME ........................................ 13
Disclaimer ......................................... 13
Technical Support .................................. 13
Registration Form .................................. 14
- 2 -
Why Leave The QB Environment To Make .EXE Files?
There are quite a few reasons to leave the congenial QuickBasic editor
for compiling and linking your programs. When you select "Make EXE File..."
QB shells to DOS and runs BC to compile the source code. Next,"
LINK is run to link in .OBJ and .LIB code to produce an exe file.
Compiling and Linking inside the QuickBasic environment is easy, but you
pay a price. Many BC and LINK options are not available...
You may like another editor better than QuickBasic's. In this case, you
may use another editor to write programs or make minor modifications to
source files and compile and link from the command line.
Large programs often become too big to run or compile in the Environment.
Such cases require that you recompile and link the program each time you
make changes just to see if it still runs. If you don't want to throw
away all your programming efforts up to that point, you must leave the
friendly QB Editor's "Make EXE File..." option behind and face a hostile
DOS prompt.
You may have object files that need to be linked with your program. Such
object code may contain screen displays, unsupported functions, replacement
routines, or most anything. OBJ files are not directly accessible to you
in the environment.
Another good reason for linking outside the environment is to take
advantage of stub files like "NOCOM.OBJ" and "NOEM.OBJ". Stub files help
reduce the size of your program by extracting unused routines.
BC and LINK both have many option switches. Of course, you can't specify
these switches inside the environment. Switches are used for optimizing
programs, changing array storage, producing list files, debugging and
more.
QuickCompile makes it easy for you to choose the right switches for your
program in two way.
1. QuickCompile searches your source code (including all modules
listed in a .MAK file and an include file) and determines many
of the necessary BC switches for you. Of course you may change
any of these if you wish.
2. Detailed on-line help is available on any BC or LINK option by
pressing F1 while the cursor is on the option or by clicking on
it with the right mouse button.
- 3 -
Quick Start Instructions
QuickCompile is very easy to use. Most QB programmers will find that
these "Quick Start" instructions are all that's necessary. However,
you should read the other information contained in this document to
better understand QuickCompile and it's many benefits.
1. Copy COMPILE.EXE and COMPILE.HLP into a directory listed in your
path statement. Preferably the \QB45 directory.
2. If you have not already done so, load your source code into the QB
editor and use the File/Save As menu command to save the source as
Text (readable by other programs). You should make a backup copy too.
3. Type COMPILE at the DOS prompt and press Enter.
4. Using your mouse or keyboard, select desired source code. Press Enter.
5. Choose <OK> when QuickCompile notes that your source code has no header.
6. Choose the appropriate Compiler Options and click on <OK> when finished.
QuickCompile automatically chooses most options for you. However, you
are free to change them as you feel necessary.
Online help is available for each option by locating the cursor on the
item and pressing F1 or clicking the right mouse button on the item.
7. Choose any libraries that are needed. Click on add to add each one to
the "Selected Libraries" box. When finished, click on continue.
8. Choose any .OBJ files that are needed. Click on add to add each one to
the "Selected Objects" box. When finished, click on continue.
9. Choose the appropriate Link Options and click on <OK> when finished.
QuickCompile automatically chooses some options for you. However, you
must choose many of them (if desired) yourself. Most Link switches
cannot be determined by the content of the source code.
Online help is available for each option by locating the cursor on the
item and pressing F1 or clicking the right mouse button on the item.
10. Add any DOS commands you want to run before and after the Compiling and
Link process. Place an & (with no spaces) between each command.
Click on <OK> when finished.
The Compiler directives will now be written to the source code in the
form of a header for QuickCompile to use in future runs.
11. Choose <NOW>. Sit back and watch BC and Link go to work.
- 4 -
How it Works
Upon execution, QuickCompile searches the selected source code (including
any files specified in the program's .MAK file (if present), and any files
listed behind a '$INCLUDE ' metacommand) for specific keywords. The chosen
file must have been saved as ascii text. If not, the user is told how to
do this. (Most experts agree, you should always save in ascii format.)
From the search information, a determination is made as to which BC
switches should be used (note: /O is always a default). A dialog box then
pops up and presents all switch choices. The ones that were previously
determined as necessary are marked. The user may make any changes he wishes
at this point and (or) click <OK> to continue. If a switch was used that
requires a number augment, an edit box pops up with the default.
You may cursor to any of these switches and press F1 or click the right
mouse button on a switch to access instant online help about that option.
Next a box is presented containing all libraries in the directory specified
in the "LIB" environment variable. If "LIB" is not set, a box pops up,
suggesting it's use, and the current directory is used. The user may change
directories or drives as necessary. QuickCompile remembers where it's
executed from and where any selected files are located.
If PDQ.LIB is selected, it must be the last library. IF not, a warning is
displayed. (Presence of PDQ.LIB also makes /NOD a link default).
After choosing any libraries that are needed, a similar box pops up with
.OBJ files. Objects that are automatically determined as necessary are
shown in the Selected Objects box. This box updates when objects are added.
If NOCOM.OBJ, _NOERROR.OBJ, _NOREAD.OBJ, or _NOVAL.OBJ is selected, /NOE
becomes a Link Default.
The Link Box (similar to the BC switches box) pops up, showing all switches
previously determined as defaults. Again, edit boxes are provided for
number augments.
You may cursor to any of these switches and press F1 or click the right
mouse button on a switch to access instant online help about that option.
Finally, edit boxes will appear and ask for any DOS commands that you
would like to run before or after compiling and linking. Multiple
commands may be entered in either box, using an & (with no spaces)
between each.
Everything that BC and Link need to know has now been determined.
This information is formatted (in a specific manner) and written to a
temporary file as a header. The source file is read and appended to this
header. Next the untouched Original source file is renamed as
<sourcefile>.BAC and the temporary file is renamed as <sourcefile>.BAS.
Now a batch file named ~M.BAT is created. This file is used to automate the
BC / Link process. If the Link command line exceeds the maximum allowable
128 characters, an additional ~M.RSP file is created. Note that both files
are deleted after compiling is complete.
The user is given the choice to compile Now or Later. If he chooses Now,
QuickCompile ends and control is passed to the batch file which performs
the compiling and linking. If Later is chosen, a message about the batch
file appears, QuickCompile ends, and the user is returned to DOS.
- 5 -
Subsequent Benefits
Once QuickCompile has been used on your source code, it will know how to
handle future compiles by reading the header information that was created
and written to the source.
To save time and unnecessary drive wear, when compiling programs with
multiple modules, QuickCompile searches for existing object code. If
any module's source has not been modified sense it was last compiled,
(object code exists with a later date/time stamp than the source) it's
existing object code is used.
Invoking From The Command Line
COMPILE <FILENAME>
Causes the file to be compiled without prompting the user. The
information contained in the file's header is used.
COMPILE (no filename specified)
Causes the QuickCompile editor to run. The user then selects the
file to compile. The user is shown all current options for the file
and is allowed to change any of them if he desires before compiling
begins. Changes are not written to the file's header.
Valid Command Line Switches
/B Run in Black & White mode. (QuickCompile automatically detects
Black and White Monitors in most cases.)
Modifying A File's Header.
Once a file has been processed by QuickCompile, the header that was created
is read to determine the proper options during subsequent compiling and
linking operations.
However, if the source code is modified later, the header may need to be
updated to reflect these changes.
The following methods may be used to change a source file's header.
Header Editing
Because the header is located at the top of the source code, it's always
available to QuickCompile. It's also always available to the programmer.
The quickest way to modify a file's header is to make your changes while
editing the source code.
<see Header Layout for correct syntax>
You may also edit a header with QuickCompile. Do not load the file from
the command line. Use the file menu to select the file and choose the
<EDIT HEADER> option. Previous parameters are displayed as you edit.
Remove Header Option
If you wish, you may use QuickCompile to remove a file header. To remove
a file's header, select the file and choose the <REMOVE HEADER> option
from the file select menu.
- 6 -
Header Layout
The first time a source file is processed by QuickCompile, a small header
is placed at it's top. This information allows QuickCompile to compile the
source in the future without requiring user input again.
The header file may be manually edited by the programmer if desired.
- SAMPLE FILE HEADER -
'εΣΘ'--- QuickCompile v1.0 -- Compiler & Linker directives. Do Not Disturb!---
'_CompileStartCommands=
'_CompileModuleFiles= MYPROG.BAS MODULE1.BAS MODULE2.BAS
'_CompileBCSwitches= /O
'_CompileBCListFile=NUL
'_CompileDeleteObjFile= 1
'_CompileLinkFiles=MYPROG.OBJ+MODULE1.OBJ+MODULE2.OBJ
'_CompileLinkLibraries=PRO.LIB+PDQ.LIB
'_CompileLinkSwitches= /E /NOD
'_CompileLinkMapFile=NUL
'_CompileEndCommands=
'---------------------------------------------- 12:48:41 -- 07-18-1991 ---ΘΣε'
- EXPLANATION -
'εΣΘ'---Identifies the start of the QuickCompile header.
'_CompileStartCommands= Any DOS commands that should precede compiling.
'_CompileModuleFiles= .BAS files that should be compiled (Found in the .MAK
file if present). If an up to date .OBJ file is found,
that file will not be recompiled.
'_CompileBCSwitches= Switches that BC (Basic Compiler) will use.
'_CompileBCListFile= Name of List file created by BC. NUL if none.
'_CompileDeleteObjFile= 1 = Delete .OBJ files after linking. 0 = Don't delete.
'_CompileLinkFiles= .OBJ files to link. (modules, nocom.obj, etc.)
'_CompileLinkLibraries= Libraries to link. (You may use more than one!)
'_CompileLinkSwitches= Switches that LINK (Linker) will use.
'_CompileLinkMapFile= Name of Map file created by LINK. NUL if none.
'_CompileEndCommands= Any DOS commands that should follow compiling.
---ΘΣε' Identifies end of QuickCompile Header.
- 7 -
Important Information & Additions
COMPILE.EXE is a self modifying program. Never run an executable file
compression utility (like PKLITE or LZEXE) on it. This will damage the
file and make it unusable. For this reason, make a backup copy of
QuickCompile and related files in case they are needed in the future.
(Note: It is ok to use ARC or ZIP on the file for transportation.)
If you change the name of your source code or one of it's modules after
the QuickCompile header has been written to it, you will need to edit
the header to reflect the new name(s). Also, any module that is added
to your program after the header was written must also be added to the
the header. You may either manually edit the header from inside
QuickBASIC, or use QuickCompile to remove it and make a new one. Editing
a header with QuickCompile will not add the additional modules.
QuickCompile does not check for LINK environment variables that may be
set. You should avoid setting any link switches this way because the
results will be unpredictable
QuickCompile is a "Shell" or "Make" utility for BC and LINK. It is possible
that the user may select options that will cause BC or LINK to crash, or
produce an executable file that doesn't operate correctly. QuickCompile
simply creates batch and response files for BC and LINK and should not
cause errors or crashes itself.
If you experience problems, carefully check all options and parameters that
you have chosen.
If necessary, manually cut the header from your file and run QuickCompile
again.
Disclaimer: The user is fully responsible for the use of this program.
Thomas Software and the Authors cannot be held liable for
any problems or situations that may arise from it's use.
MicroSoft and QuickBASIC are registered Trademarks of MicroSoft
Corporation. PDQ is a copyrighted product of Crescent Software.
QuickCompile is a copyrighted product of Thomas Software.
TECHNICAL SUPPORT
Technical support is available to registered users by mail at the
address below or by Email on Compuserve to: 71071,2166 or 75720,3376
Thomas Software
1375 Beasley Rd.
Jackson, MS 39206
- 8 -
NOCOM.OBJ
(No Communications Routines)
When your source file includes an OPEN statement with a string variable in
it, BC will automatically include all com port routines. This happens
whether you are calling COM or not. 4K bytes in executable file size can be
saved by linking with NOCOM.OBJ in these cases. Linking with NOCOM.OBJ when
not necessary will increase your .EXE file size by 32 bytes, so observe the
the following rules.
OPEN FILE$ FOR INPUT AS #1 Will cause the com routines to be
included. You should link NOCOM.OBJ.
OPEN "MYFILE.TXT" FOR INPUT AS #1 Will not cause com routines to be
included. You should not link with
NOCOM.OBJ.
When Linking with NOCOM.OBJ you must specify the /NOE switch so that LINK
will search the object file instead of the dictionaries it has created
to resolve conflicts. QuickCompile automatically selects this option for
you.
Of course, if your program does use com routines, do not link with
NOCOM.OBJ.
When MicroSoft packaged QuickBASIC 4.5, they failed to include the object
file "NOCOM.OBJ". If you order the program disk when you register
QuickCompile, you receive (free of charge) NOCOM.BAT and NOCOM.SRC. Run
NOCOM.BAT to create a copy of NOCOM.OBJ if you don't already have one.
NOEM.OBJ
(No Floating Point Emulation
Math Coprocessor installed.)
When a program will always be run on a computer with an 8087, 80287, or
80387 math coprocessor chip, QuickBASIC's software emulation of the math
chip's function are not necessary.
Linking such programs with NOEM.OBJ reduces the size of the executable
file by excluding emulation routines and speeds program execution by
allowing the coprocessor to operate.
When Linking with NOEM.OBJ you must specify the /NOE switch so that LINK
will search the object file instead of the dictionaries it has created
to resolve conflicts. QuickCompile automatically selects this option for
you.
If there is a possibililty that a program will be run on a computer without
a math coprocessor, DO NOT link with NOEM.OBJ.
- 9 -
SMALLERR.OBJ
(No Error Messages)
If your program has been tested, and you feel that QuickBASIC's Error
Messages are not necessary at run time, you may further reduce the size
of the .EXE file by linking with SMALLERR.OBJ.
Linking with this file reduces program size about 1278 bytes by deleting
the text of error messages from your program. However, Error numbers will
still be displayed if a run time error does occur.
When Linking with SMALLERR.OBJ you must specify the /NOE switch so that
LINK will search the object file instead of the dictionaries it has
created to resolve conflicts. QuickCompile automatically selects this
option for you.
We suggest that you always link the final version of your program with
SMALLERR.OBJ. You'll still get error numbers that can be looked up in the
QuickBASIC manual if an error ever occurs.
OPTIONAL UTILITY PROGRAMS
NOTE: Registered QuickCompile users who purchase the optional program
disk receive the following utility programs too.
EXISTS.BAS Module
(Check for existance of a file)
To help you avoid QuickBASIC's ON ERROR statements (and it effects on
program speed and file size), included on the optional program disk is
a Basic Module for you to add to your own programs.
EXISTS.BAS is used to determine if a file is present before your
program attempts to open it.
To add this function to your program, load your program into the QB
Environment with the following line:
QB MYPROG.BAS /L QB
Then, select "Load File" from the "File" menu and add EXISTS.BAS as a
module. Add the following declaration to your program.
DECLARE FUNCTION Exists%(FileName$)
The following is an example of how Exists may be used in a program.
IF Exists%(FileName$) THEN
PRINT FileName$; "File found..."
ELSE
PRINT FileName$; "File not found..."
END IF
EXISTS.BAS uses QuickBASIC's Call InterruptX routine to check for the
existence of the specified file. For this reason, you will need to link
with QB.LIB (the default QB library included with QuickBASIC).
Be certain to select QB.LIB as a library to link with when using
QuickCompile.
(cont.)
- 10 -
We recommend that your programs should always check to see if a file is
present before trying to open it. This way, you can prevent user confusion
in case the file is not available.
The EXISTS.BAS file is heavily commented so that you can see exactly
how it works. Interrupts are a great way to perform tasks that
QuickBASIC can't.
CHK4QC
Check for QuickCompile Headers
A small utility is included to check your QuickBasic source code for the
presence of QuickCompile headers. CHK4QC displays the version of
QuickCompile used and the date that the header was written.
Note: All source code files must have been saved in ASCII.
Using CHK4QC
You can run CHK4QC by simply typing the program name at the command prompt
or use one of the switches after the program name.
EXAMPLE:
CHK4QC /P Will send output to printer.
Valid Command Line Switches:
/P - Sends the output to your printer
/? - Displays online help screen
After running the program, a list of source code files (containing
QuickCompile Headers) in the current directory will be displayed on
your monitor. If the /P switch is used, the output will be sent to the
printer instead. To check files in any directory, put CHK4QC in a
directory listed in your path statement and run CHK4QC from the desired
directory.
- 11 -
80X
EGA/VGA Monitor Utility
80X is a small command line or batch file utility for changing the number
of lines displayed on EGA or VGA monitors in text mode.
VGA users often find it useful to change to 50 (43 for EGA) line mode
before loading the QB Editor. This way, more lines of source can be
displayed at once.
Using 80X
First, place the 80X.COM file in a directory listed in the PATH
statement of your AUTOEXEC.BAT file.
At the command line type: 80X <number of lines>
Where <number of lines> is a number that is supported by
the installed monitor and graphics card.
25, 43, 80 For VGA
25, 43 For EGA
The command 80X 50 would change the monitor to 50 line mode.
Batch File Usage
You might wish to use 80X from a batch file to change to a certain
number of lines before loading a specified program, then back to another
when the program terminates.
The following lines typed from the command prompt would create a batch
file titled QB50.BAT which will run the QB Editor in 50 line mode, and
then switch back to 25 line mode when QB is exited.
COPY CON QB50.BAT
80X 50
QB %1 %2 %3 %4 %5
80X 25
<Ctrl-Z>
Now you could type: QB50 MYFILE.BAS /L MYLIB
This would load MYFILE (with MYLIB quick library) into the QB editor
in 50 line mode. When QB is exited, the monitor would return to 25 line
mode.
To have a source file execute in 25 line mode (while the QB editor is in
50 line mode), the following line should be inserted near the top of the
source code.
WIDTH 80, 25
- 12 -
FILETIME
Time/Date Stamp Utility
FileTime is a small, easy to use utility program for programmers who
wish to change the Date/Time Stamp on a group of files before
distribution.
Using FileTime
First, place the FILETIME.COM file in a directory listed in the PATH
statement of your AUTOEXEC.BAT file.
1. Go to the directory that contains files that you wish to restamp.
2. Type FILETIME.
3. Use the cursor keys or mouse to move about the menu and mark files
to be restamped.
Press the Space bar or double click the left mouse
button to mark a file.
Pressing Escape will abort the program if necessary.
Once the files that you wish to restamp have been
marked with a √, press F1 to continue.
4. At the prompt, enter the new Date to use. Just press Enter to use
the current system date.
5. At the prompt, enter the new Time to use. Just press Enter to use
the current system time.
6. At the prompt, press y or n to restamp the files with the Date
and Time that was just entered.
Disclaimer: The user is fully responsible for the use of these program.
Thomas Software and the Authors cannot be held liable for
any problems or situations that may arise from it's use.
TECHNICAL SUPPORT
Technical support is available to registered users by mail at the
address below or by Email on Compuserve to: 71071,2166 or 75720,3376
Thomas Software
1375 Beasley Rd.
Jackson, MS 39206
- 13 -
QuickCompile v1.0 REGISTRATION FORM
Please print or type in the information on this form and mail it
with your $14.95 ShareWare registration fee to:
Thomas Software
1375 Beasley Rd.
Jackson, MS 39206
Upon receipt of this form and registration fee, Thomas Software grants
the user a limited license to use this software. Registered users will
receive a registration code number.
Please include an additional $10.00 for a disk of the latest version of
QuickCompile, as well as the utility programs listed in COMPILE.DOC.
USER INFORMATION
Name:_________________________________________________
Company:______________________________________________
Address:______________________________________________
______________________________________________________
City:_______________________ State:__________________
Zip:_____________
Amount Enclosed: [ ] $14.95 - Registration code only.
or
[ ] $24.95 - Registration code and disk.
Disk Size: [ ] 5 1/4" - 360K
[ ] 3 1/2" - 720K
COMPUTER INFORMATION
(optional)
Brand:_______________________________________ Model:________________
Dos Version:____________ QuickBasic Version:____________
Processor: [ ] 8088 [ ] 286 [ ] 386 [ ] 486
Monitor: [ ] Mono [ ] Herc [ ] CGA [ ] EGA [ ] VGA
Comments:____________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
By registering your copy of this software, you encourage the
authors to continue distributing useful programs via ShareWare.