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.
Parameter | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tablename | Table containing the row containing the source code to be compiled. Optional. | ||||||||||||||||||||||
code | A 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:
| ||||||||||||||||||||||
status | Boolean result flag (1 = successful compilation; 0 = failed compilation) | ||||||||||||||||||||||
type | Type 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 subroutine, Repository("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)