_main.tfile | source file |
Classes Summary | Objects Summary | Functions Summary Details |
This module defines a number of low-level functions and classes that most TADS 3 programs will need, whether based on the adv3 library or not. This module includes the main program entrypoint, the basic Exception classes, and the modular initialization framework.
The compiler automatically links this module into every program by default, but you can override this by specifying the "-nodef" option to t3make. If you remove this module, you'll have to provide your own implementations for many of the functions and classes defined here.
BreakLoopSignal
CircularExecException
Exception
InitObject
ModuleExecObject
OneOfIndexGen
PreinitObject
ProgramException
RestartSignal
RuntimeError
SpecialsToHtmlState
StorageServerError
T3StackInfo
UnknownCharSetException
_default_display_fn
_init
_main
_mainCommon
_mainRestore
_outputCapture
_preinit
dataTypeXlat
flexcall
forEachInstance
initAfterLoad
instanceWhich
_default_display_fn (str) | _main.t[968] |
_init ( ) | _main.t[558] |
_main (args) | _main.t[27] |
_mainCommon (args, restoreFile) | _main.t[59] |
_mainRestore (args, restoreFile) | _main.t[49] |
Note that we must export this as the 'mainRestore' symbol so that the interpreter knows how to find it.
_outputCapture (func) | _main.t[974] |
_preinit ( ) | _main.t[540] |
The advantage of doing work during pre-initialization is that this work is done once, during compilation, and is thus not repeated each time a user starts the program. Time-consuming initialization work can thus be made invisible to the user.
Note that the pre-initialization code should never do anything that involves the user interface, since this code runs during compilation and does not run again when users start the program. So, anything that you want a user to see must be done during normal initialization (such as in the main() routine), not here.
dataTypeXlat (val) | _main.t[631] |
flexcall (func, [args]) | _main.t[185] |
forEachInstance (cls, func) | _main.t[575] |
The callback is invoked with one argument, which gives the current instance. The callback can "break" out of the loop by throwing a BreakLoopSignal, which can be done conveniently using the breakLoop macro.
initAfterLoad ( ) | _main.t[239] |
instanceWhich (cls, func) | _main.t[598] |