Compiling the Program

Source code must be compiled before the program can be executed. The source code can be written and edited by the programmer, but since it cannot be directly interpreted by the mvBase system until it is translated into object code, the compiler translates source code into object code and places a pointer to the object code in the file dictionary.

The compiler can therefore be thought of as a translator from your language (or more accurately, the language of mvBASIC) into the machine’s language.

Two (synonymous) commands can be used to compile a program, BASIC and COMPILE.

Format

BASIC filename progname-list [(version#,options)]

Format

COMPILE filename progname-list [(version#,options)]

Parameter(s)

filename

Name of the mvBASIC program file

progname-list

Contains the item-IDs of the programs to be compiled. An asterisk (*) specifies all programs in the file.

For example, to compile the program ADDNUMS in the file BP, type:

>COMPILE BP ADDNUMS

or:

>BASIC BP ADDNUMS

If the compile is successful, the user sees something similar to:

>BASIC BP ADDNUMS

*********

SUCCESSFUL COMPILE!  1 FRAMES USED.

 

>

The asterisks (*) each represent a source line successfully compiled into object code. If an error occurs in compilation, the error code is printed with a message. See Appendix A: Error Messages for a list of error messages generated by the COMPILE command.

The following topics are presented in this section:

Option for Debugging a Program (X)

Options for Cataloging (C, S)

Listing the Source (L)

Printing Compiler Output (P)

Specifying a Version of the Operating System

Obtaining the Compilation Time and Date

See Also

Creating mvBASIC Programs

Creating the Program File

Editing and Listing the Source Code

Running the Program

Cataloging the Program

A Sample Program