TRIX ==== Tricksy command to test whether a bespoke toolkit is loaded or not. SMSQ/E only Usage ----- SBASIC programs can be EXECuted, RUN, or started in other ways. Sometimes such programs can benefit from special toolkit commands that you may not wish to load into your main system. If you simply EXecute your program on each invocation you could just add a line in your code like 103 LRESPR mytoolkit to unconditionally load the toolkit on each call. Once the program or script has done its business it goes away and its toolkit dies with is leaving no residue. However, on occasion, or for a different use of your program you may wish to RUN it, either in your main interpreter or in a daughter SBASIC, then on each run the toolkit would be reloaded eating up memory on each invocation. In such cases you could, of course, just load the toolkit manually, ie not as part of your code - if you can remember where it is located - and if loading it into a SBASIC daughter console, also remember to load it AFTER you loaded your SBASIC program otherwise the toolkit will just disappear again, as will it if your type CLEAR, NEW etc. TRIX could be the simple solution to these various scenarios. Just add it to any bespoke toolkit you use in such circumstances - it only adds a few extra bytes, and then add something like the following line to your code: 103 IF NOT TRIX%: LRESPR 'win1_extras_MySpecialToolkit_bin' Since TRIX is designed to be added to bespoke toolkits as in my Pick'n'Mix toolkits described in Knoware.no/Toolkits, you can easily call this command anything you like, which is useful to avoid confusion. Thus if your toolkit were called FFILL_bin, you might call TRIX% FFILL% instead, thus: 103 IF NOT FFILL%: LRESPR HOME_DIR$ & 'FFILL_bin' The reason TRIX% works is that SBASIC assigns a zero value to unassigned variables, so, given the example above, if you PRINT FFILL% and the toolkit FFILL_bin is not loaded it will print 0; if FFILL_bin is loaded FFILL% with return integer 1. This doesnt work in Qdos/Minerva as the SuperBAASIC interpreter would simply error on an unassigned variable, as would Qlib and Turbo. However, if the program is to be compiled LRESPR doesnt make sense anyway. In Qlib you could then simply wrap the line in off/on directives: 102 REMark $$off 103 IF NOT FFILL%: LRESPR HOME_DIR$ & 'FFILL_bin' 104 REMark $$on Turbo probably has corresponding directives to exclude code from compilation. Program notes ------------- This toolkit comes only as a source file as it doent make any sense on its own! To add it to a bespoke toolkit simply add the following line to the function part of your key file: proc_def FFILL%,trix and in some suitable place in your Qmake link file: input etc_TRIX_rel and then Make. And thats it! Program status -------------- V0.01, pjw, 2022 Oct 29 Conditions of use and DISCLAIMER as per Knoware.no
Generated by QuickHTM, 2022 Nov 05