Description

Calls the BASIC+ compiler. You can determine whether a program compiles correctly, and if not, to determine compilation errors.

Use RTP5 to get more detailed information about the result of a compile than from calling Recompile_Proc or Repository("COMPILE").

Syntax

RTP5(tablename, code, parameters, status, type)

Parameters

The RTP5 subroutine has the following parameters.

ParameterDescription
tablenameTable containing the row containing the source code to be compiled. Optional.
codeA variable containing the code to be compiled. Delimit each line with field marks.

Note: If the compilation succeeds, code contains the object code generated by the compiler. If compilation fails, the compilation error messages are returned here, replacing the code. This means that code will never contain the source code after the call to RTP5.

parameters

Dynamic array containing two fields:

Field No.Description
<1>Title to display while the compiler is compiling.
<2>Compiler options (these can be combined):
 
OptionDescription
CCut off symbol table
EReturn reasons for failure in @FILE.ERROR instead of displaying an error message
IDisplay $INSERT message even if S option is set
NIgnore freespace check
SSuppress informational message display
UDo not buffer the compiler
statusBoolean result flag (1 = successful compilation; 0 = failed compilation)
typeType of compilation:

M = code D = dictionary

Note: When RTP5 is called, the compiler attempts to compile the code in code. If compilation fails, the compiler-generated error list is returned here, with the following structure,

<1> = "ERROR.LIST" (a literal)

<2,1> = Line number of error

<2,2> = Error number

<2,3> = Error parameters (as many as necessary)

The error list group in field 2 repeats for all the errors generated by the compilation.

See also

Recompile_Proc subroutineRepository("COMPILE")Repository("TCOMPILE")

Example

/* compile a program that produces the 'Hello world' message */
code = "call msg(@window, 'Hello world')" : @fm: " return 0":@fm:" end"
status = ''
title = 'This is the title to show while compiling.'
type = 'M'
call rtp5('', code,title ,status, type)
  • No labels