[ Back ]
When you compile a program, two files are generated: the executable and file with the extension .sbe. The sbe is a program unit file and contains pure naalaa bytecode. Usually the sbe file can be deleted, as it is also baked into the executable file. But it is possible to stop the execution of a program and start executing another sbe. In that case the sbe of the external program is needed (at least for a while).
procedure run sbe_filename$
args$[]
procedure include sbe_filename$
Stop execution of the current program and run an external (or included) program unit, sbe_filename.
The string array args can be used for passing parameters between program units, as it remains untouched when a new program unit is executed.
With this compiler directive you can include external program units in your current program. This makes the resulting executable file independent of all sbe files. It is very important that every program unit is only included once in the entire program (usually in the unit that is to be launched first). You can even use a pure launcher for the entire program that gathers all the program units and creates a final executable. Ex:
rem A game.
include "main.sbe"
include "hiscore.sbe"
include "the_end.sbe"
run "main.sbe"
[ Back ]