06.11.2013 Views

The Basis System - Weapons and Complex Integration - Lawrence ...

The Basis System - Weapons and Complex Integration - Lawrence ...

The Basis System - Weapons and Complex Integration - Lawrence ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

call ptext(msg)<br />

which is to write messages on graphics frames, if desired. <strong>The</strong> user-supplied ptext is responsible<br />

for frame advances, etc.<br />

72.4 Replaceable Routines<br />

<strong>The</strong>re are some routines which you can replace with your own versions. You merely need to be<br />

sure that the binary for your routine is encountered first in the load process.<br />

72.4.1 User main routine<br />

<strong>Basis</strong> calls a subroutine usrmain immediately after collecting comm<strong>and</strong> line arguments. If you<br />

need to do special initialization or to process the comm<strong>and</strong> line yourself, provide your own version<br />

of usrmain. Normal basis error recovery procedures are not yet installed at this point. <strong>The</strong><br />

default usrmain calls basmain; your replacement needs to do that too. Any remaining text in<br />

cmdline is treated as the first line of input by basmain.<br />

subroutine usrmain(argv0, cmdline)<br />

character*(*) argv0,cmdline<br />

call basmain(argv0,cmdline)<br />

return<br />

end<br />

72.4.2 Custom h<strong>and</strong>ling of input<br />

Each line read from an input file is made available to a user-replaceable routine called basisech.<br />

<strong>The</strong> default version (see below) does nothing.<br />

subroutine basisech(line,nline)<br />

character*(*) line<br />

integer nline<br />

return<br />

end<br />

72.4.3 Error h<strong>and</strong>ling<br />

When <strong>Basis</strong> encounters an error in its input, it normally calls a routine named kaboom, to reinitialize<br />

the parser <strong>and</strong> restore data structures to a clean state if possible. During error recovery, it<br />

calls a user-replaceable routine named basiserr, which, by default, does nothing:<br />

72.4. Replaceable Routines 417

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!