RTP5 subroutine (BASIC+ Compiler)

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").

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

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.
parametersDynamic array containing two fields:

Field No. - Description
<1> - Title to display while the compiler is compiling.
<2> - Compiler options (these can be combined):
C (Cut off symbol table)
E (Return reasons for failure in @FILE.ERROR instead of displaying an error message)
I (Display $INSERT message even if S option is set)
N (Ignore freespace check)
S (Suppress informational message display)
U (Do 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.

/* 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)
  • guides/programming/programmers_reference_manual/rtp5.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1