compile

compile


compare-list Index Level compile-catalog
Syntax compile file.reference itemlist* {(options}
Category TCL
Type Verb
Description The "compile" verb invokes the Pick/BASIC compiler and translates the specified source code into executable object code with case insensitivity.

Case "insensitivity" means that the variables "TOTAL", "Total" and "total" all represent the same symbol. A case "sensitive" state would treat these as three separate variables.

Each line of the source program is scanned for syntax errors during compilation, even after an error has been detected.

A "." (period) is displayed for every 10 lines of code. This change allows compilation to proceed much faster.

If an error is encountered, the line with the error and the error message are displayed; no object code is produced. The "q" option prevents the messages from scrolling past on the terminal.

If the "o" option is used, FlashBASIC is invoked after the first stage of compilation is complete.  When all stages are completed, and if no errors are found, the compiled form is saved and can be executed using the "run" verb. The program may also be "cataloged" with the "catalog" verb.

"itemlist*" consists of one or more source program names, separated by spaces.  If no name is specified, or if an asterisk (*) is used, all programs in the file will be compiled.

Programs may be created and modified using UP. They can be compiled when exiting UP by using either the <ctrl>+xc command, which compiles and catalogs the program, or the <ctrl>+xr command, which compiles and runs the program. Any other editor may also be used.
Options a  Displays object code generated by Pick/BASIC compiler.

b  Turns on array bounds checking when used with the "o" option level 1-9. Without this option in effect, situations such as "array subscripts out of range", which would formerly result in a "fatal" Pick/BASIC debugger abort, will ignore the condition, possibly resulting in a monitor halt. This option is not necessary when using the "o" option level 0 (the default), or when not using the "o" option at all.

c  Compresses the object by suppressing the end-of-line (EOL) opcodes from the object code item. This option is designed to be used with debugged and cataloged programs. Because the EOL opcodes are used to count lines for error messages, any runtime error message in a program compiled with the "c" option will indicate the error is on line 0. Additionally, the "c" option removes the ability to single-step with the Pick/BASIC debugger.

d  Prevents the run-time "d" option from entering the debugger.

e  Lists only error lines encountered during the compilation of the program. The listing indicates line number in the source code item, the source line itself, and a description of the error associated with the line.

f  When used with the "o" option, generates floating point arithmetic.

h  Hides FlashBASIC object code from other users.  In other words code is not shared.

i  Lists lines from any included program as part of the listing. If used with the "l" option, the source program listing, the included lines are indicated by a "+" after the line number.

k  Keeps a shared, FlashBASIC module loaded.  See the "shpstat" program for more information about shared loading.

l  Generates a line by line listing of the source program during compilation. Error lines with associated error messages are indicated. When the "l" option is used, "*"'s are not displayed. Each line of the listing takes the place of the "*".

m  Generates a program "map" of the descriptor table and correlates source code lines to generated object code frames. Each variable in the program is listed along with its decimal offset.

n  No pause; suppresses pause at end of page on terminal display.

o{level.number}  Produces FlashBASIC optimized code.  This option may be followed by a number from 0 to 9, which indicates the FlashBASIC (optimization) "level". If not specified, the level defaults to 0. Level 0 generates optimized cross-platform compatible code. This code is much smaller than level 1 code and can be moved from platform to platform.  Level 1 generates platform-specific code which tends to be about 10% faster than level 0 code. Levels above 1 produce platform-dependent code with incrementally smaller performance increases than that obtained by level 1. Using such high optimization settings can make compile time take several times longer and should not be used except where performance is absolutely critical. Note that if any module in a program is compiled with the "o" option, then all modules. See the related subjects on FlashBASIC for more information.

p  Routes all output generated by the compilation, except the cross-reference listing, to the printer, via the Spooler.

s  Suppresses generation of symbol table. The symbol table is used exclusively by the Pick/BASIC debugger for reference; therefore, it needs to be kept only if the user wishes to use the debugger.

x  Creates a cross-reference of all the labels and variables used in the Pick/BASIC program and stores this information in the "bsym" file, which must exist before using. The "x" option first clears data in the "bsym" file, then creates an item for every variable and label used in the program, using the variable or label name as the item-id. After creating the cross-reference items, attribute one contains the line numbers where the variable or label is referenced; each line number is a value. The line number where a label is defined, or where the value of the variable is changed is preceded by an asterisk (*). If the variable  names and labels are in both upper and lower case, the "d-pointer" for the "bsym" file-defining item should not have the "s" option.

w  Optimizes without source when used with the "o" option.  This allows optimizing programs without source code.  This option requires a list of the items in the dictionary level of the file to be active prior to use.  Note that the normal dictionary object statistics are not updated when this option is used.

y  Allow multiple FlashBASIC compiles concurrently.  Normally, each FlashBASIC  compile attempts to set BASIC lock 49 to keep multiple compiles from dramatically slowing down the machine.  The Y option avoids this logic.

On D3/Unix releases, default options may be stored in attribute 6 of the "compile" item in your master dictionary. For example, putting an "o" in this attribute makes all compiles in that account produce FlashBASIC code.
See Also FlashBASIC Compile stamps compile-run FlashBASIC performance FlashBASIC error logging edit config core g compile-catalog debugger c/options c/bytes c/flash c/fid c/size c/date c/time c/port c/user c/acct c/release BASIC
Example compile dm,bp, term-type (lp

This compiles the "term-type" program and sends the listing to the printer.

compile bp j (oc

This creates a FlashBASIC native object module which may be run from Pick as if it were an interpreted Pick/BASIC program.  The "c" option is used primarily to reduce object size and compile time, both of which can be significantly greater when using FlashBASIC.

select dict bp.old

[404] 114 items selected from 114 items.

compile bp.old (ow

This creates FlashBASIC code for all the Pick/BASIC object pointers in "bp.old".  There is no need to have the source present.

ct md compile

001 VR
002 3]9
003 F
004 dm,bp, :ccompile
005
006 o

Notice that an "o" was placed in attribute 6. This verb, when invoked will always Flash compile programs. (see o option)
Warnings Compilation with the (o flag may take a long time to compile and tends to use a great deal of the machine's resources. This problem can be especially acute when using an optimization level greater than one. It is recommended to do large, FlashBASIC compiles at off-peak hours.

An error encountered deep within nested logic can produce several screens of "erroneous" error messages. The actual error is the first message listed.
Compatibility D3 7.0 D3 7.1
compare-list Index Level compile-catalog