Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
The preferred method for compilation is from the UltraEdit text editor.
Compilation commands may be indicated in an IB comment at the top of the source program. The format is:
! //IB// Src(sample1.ibs,dsk) [Obj(sample1,app)] [Opt(xyz)]
where:
As an alternative for users who do not have UltraEdit, the legacy syntax for compiling though either the MTB or IB program from within Comet should use the following compiler commands:
Compiler command | Purpose |
---|---|
SOURCE | This option is used to specify the source program
name.
Syntax: SOURCE source-program-name [,directory-name] The SOURCE command may be abbreviated to the letter S, spelled-out in part (e.g., SO, SOU), or spelled- out in full. The source-program-name parameter is the name of the source program you want to compile. The directory-name parameter may be used to specify the directory location of the source program. If this parameter is not included, Comet will search through the currently accessed directories for the source program. |
OBJECT | This option is used to specify the object program
name.
Syntax: OBJECT object-program-name [,directory] The OBJECT command may be abbreviated to the letter O, spelled-out in part (e.g., OB, OBJ), or spelled out in full. The object-program-name parameter is the name of the object program to be created by the compiler. The directory-name parameter may be used to specify the directory location for the object program. If this parameter is not included, the compiler will create the object program on a directory named DSK (if one exists). If the specified directory (or the default directory DSK) does not exist, the compiler will not create an object file. |
LIST | This option is used to specify the compiler options.
Syntax: LIST output-device [,compiler-option] [,compiler-option] [,compiler-option]... The LIST command may be abbreviated to the letter L, spelled-out in part (e.g., LI, LIS), or spelled-out in full. The output-device parameter is used to specify the printer or terminal name where the output will be directed (e.g., LP1, LP2, T00, SP1). The default output device is your terminal. The compiler-option parameter is used to specify one or more compiler options. These options are specified by including a comma and the option following the output-device parameter. Option Description B byte-align COMMON E errors only (default) S source listing X create cross-reference file L create .LST listing fileExample: L LP1,B In this case, the compiler will print a source listing on printer LP1, and byte-align the COMMON fields. |
RUN | This option is used to specify the program to be run
after compilation.
Syntax: RUN program-name ["message"] The RUN command may be spelled in part or in full (e.g., R, RU, RUN). The program-name parameter represents the object program you want to run after the compiler is done compiling your program. The message parameter specifies data that is to be passed in COMMON to the program-name. Example: R LISTXREF "SYSTEMA" In this example, LISTXREF might be a program that processes the cross reference file from the compile which needs the name of the program just compiled (i.e., SYSTEMA). |
* | This option is used to compile multiple programs in
one command file.
Syntax: * [command-file-name] [,directory] [editor-line-number] The asterisk is used to specify that multiple source programs are to be compiled. In its simplest form, the asterisk used by itself (with no parameters) indicates that the command file has additional compiler commands þ the compiler will continue with the next command in the command file. The optional parameters with the asterisk command can be used to direct the compiler to another command file name. In this case, the name of the command file, its directory, and even its starting editor line number may be specified. This is essentially a "GO TO" directive for the compiler þ it passes the direction to an entirely different command file name. |
The compiler command lines may be used in two ways: they may be included at the very beginning of an Internet Basic source program, or they may be contained in a separate command file.
If they are included at the beginning of an Internet Basic source program, they should be written as comment lines (i.e., they should start with the exclamation mark comment character). For example, the following lines could be included at the start of a source program:
! S XSAMPLE,DSK ! O SAMPLE,DSK ! L LP1 ! R QMONITOR ! LENGTH 2 & LOCAL FLAG$ LENGTH 6.0 & LOCAL CRLIMIT (etc.)In this case, when the Internet Basic compiler is invoked, the source program can also be used as the command file for the compiler; the first four lines are read and used by the compiler as command statements. In the example shown, the first four lines specify the source program name, the desired object program name, the listing device for the compiler output, and the name of the program to run after compilation.
The Comet editor program (CED) allows you to send a message in common memory to the compiler program; the message is the name of the command file to be used. For example, you can run the compiler using the / command and send it the name of the open editor file (a compiler command file), as follows:
/MTB or /IBIf you want to compile several programs at once, you can create a command file just for this purpose. In this case, the command file will not contain Internet Basic source statements, but will just contain compiler commands. For example, the following command file will result in the compilation of four separate source programs:
S XSAMPLE,DSK O SAMPLE,DSK L LP1 * S XTEST,DSK O TEST,DSK L LP1,E * S XALPHA,DSK O ALPHA,DSK L LP2 * S XBETA,DSK O BETA,DSK L LP1 R QMONITORNotice that the * command indicates that additional programs are to be compiled.
The above command file can be created with the Comet editor and used as the compiler command file. This command file can be used repeatedly to recompile these four programs. This technique is useful for software developers wanting to perform a "mass compile" of an entire application package.