Op 17/08/2017 om 12:40 schreef Dilwyn Jones via Ql-Users:
In that sense, the easiest way is to load the smallest keyword checking extension and just accept the chicken and egg scenario and that there is a risk that you may multiply-load that one small extension.

One such extension is Phil Borman's EXISTS (on Toolkits page on my site). Be aware that if it is to be used on more than your own system on pre-JS ROMs you can't use the extension in the same BASIC boot program that loads it, so you'd have to use the first BOOT program to install the EXISTS extension, then LRUN a second boot program to actually use it on version AH or JM ROMs.

Another way of doing this which may be good enough for most purposes is to assume that all your systems contain Toolkit 2 or a subset of, which contains the EXTRAS keyword (most will apart from 128k MDV-only systems). This method was suggested to me a long time ago by John Gilpin - send a list of EXTRAS to a file somewhere and read that file back to check for a keyword. A bit fiddly and prone to go wrong when you have toolkits with duplicate keyword names I suppose. Then you could write a little function like this (not tested, just quickly wrote it as I type):

DEF FN CHECK_FOR(keyword$)
 LOCAL found%,t$
 found% = 0 : REM assume not found
 OPEN_NEW #3,ram1_test : REM choose your own filename
 EXTRAS #3 : CLOSE #3
 OPEN_IN #3,ram1_test
 REPeat read_back
   IF EOF(#3) : EXIT read_back
   INPUT #3,t$
   IF t$ == keyword$ THEN
     found% = 1 EXIT read_back : REM keyword name matched
   END IF
 END REPeat read_back
 CLOSE #3 : DELETE ram1_test : REM remove the evidence
 RETurn found%
END DEF CHECK_FOR

Then if this function is appended to your boot program, use a line like IF CHECK_FOR("TK_VER$") = 1 THEN PRINT"Turbo Toolkit loaded" (or a known keyword from another toolkit of course)

Not the full answer you were hoping for but one which can cope with most situations apart from unexpanded BBQL.

Dilwyn

-----Original Message----- From: Tobias Fröschlevia Ql-Users
Sent: Thursday, August 17, 2017 10:25 AM
To: ql-us...@q-v-d.com
Cc: Tobias Fröschle
Subject: Re: [Ql-Users] TURBO and testing it exists

Lee,

there are a number of toolkits that allow you to check for specific other toolkit commands loaded or not - But this is a bit useless as it leaves you with a chicken-and-egg problem: How to check whether the checking toolkit is loaded?

Your best bet on SMSQ/E would be a WHEN ERRor clause you place just in front of a Toolkit command you are about to execute:

1000 TurboTkLoaded = 1
1010 WHEN ERRor
1020    TurboTkLoaded = 0
1030 END WHEN
1040 REMark Execute a Toolkit command
1050 MANIFEST : x = 100
1055 REMark de-activate error checker
1060 WHEN ERRor
1070 END WHEN
1080 PRINT "Turbo Toolkit loaded:"!TurboTkLoaded

On a QL with non-working WHEN ERRor commands (pre-MG) you are a bit doomed, the only thing I could probably come up with is writing a BASIC program that PEEKs the name list, which is not quite so simple.

Tobias


Am 17.08.2017 um 10:49 schrieb Lee Privett via Ql-Users <ql-users@lists.q-v-d.com>:

I originally posted this on the forum:

Hi community, I have searched for this on the forum but cannot find an
entry but I am sure this has been asked before.

I currently test for the presence of the HBA ROM in a boot program using
VER$ and would like to test for other toolkits, specifically the TURBO
toolkit. Is there a way to do this automatically in a boot so that when
subsequent runs of the boot it is not loaded again in one session?

e.g. for the HBA version I use:

Code: Select all <http://qlforum.co.uk/viewtopic.php?f=3&t=2063#>
IF VER$<>"HBA" THEN
  LRESPR "WIN8_SMSQ_QEM"
END IF


I feel there must be a way to test for TURBO toolkit, any ideas?

A reply from Derek suggested  the following:

There is a keyword: TK_VER$, but only returns the version of Turbo Toolkit,
which is the same for the SMS and QDOS versions.

A simple way would be to add "SMS" in the version number. Which would mean
a new version of Turbo Toolkit.

The SMS version calls the SMSQ/E extended traps, where the QDOS does not,
so maybe a test for SMSQ/E extended traps is the way, but I would favour
the about alteration to TK_VER$.

George Gwilt used to maintain Turbo and maybe the Toolkit. I think this
message needs to be posted in the QL-USERS mailing list, George Gwilt reads
that list.

Any views at all?

Regards Lee Privett
_______________________________________________
QL-Users Mailing List

_______________________________________________
QL-Users Mailing List

---
This email has been checked for viruses by AVG.
http://www.avg.com
_______________________________________________
QL-Users Mailing List


Dilwyn's CHECK_FOR(keyword$) is of course only reliable as interpreted AND in job 0.

François Van Emelen


_______________________________________________
QL-Users Mailing List

Reply via email to