Page 1 of 2

Testing for installed TURBO

Posted: Thu Aug 17, 2017 8:41 am
by Mr_Navigator
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

IF VER$<>"HBA" THEN
   LRESPR "WIN8_SMSQ_QEM"
END IF
I feel there must be a way to test for TURBO toolkit, any ideas?

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 9:02 am
by NormanDunbar
Morning,

DJToolkit could help. It has a function called CHECK that looks for a particular function or procedure, so you could use that to determine if a given toolkit is installed.

Details at http://superbasic-manual.readthedocs.io ... html#check

Of course, how do you check that DJToolkit is installed? ;)

HTH

Cheers,
Norm.

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 9:18 am
by Derek_Stewart
Hi,

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.

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 9:37 am
by Martin_Head
Could you use the WHEN ERROR trapping (JS ROMs upward).

Try to use a Turbo Toolkit command, if the toolkit is not installed the command will be trapped in the WHEN ERROR clause, and then the toolkit can be loaded.

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 9:51 am
by Mr_Navigator
Derek_Stewart wrote:Hi,

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.

Many thanks Derek I have now done this

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 9:53 am
by Mr_Navigator
Martin_Head wrote:Could you use the WHEN ERROR trapping (JS ROMs upward).

Try to use a Turbo Toolkit command, if the toolkit is not installed the command will be trapped in the WHEN ERROR clause, and then the toolkit can be loaded.

I will try this also Martin, thanks

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 10:43 am
by Derek_Stewart
Hi Lee,

Looking at my boot file for SMSQmualtor/QPC2/Q-EMulator, I use this If clause:

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF
Seems to work for QDOS and SMSQ/E.

But I guess there are other solutions.

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 11:23 am
by Mr_Navigator
Derek_Stewart wrote:Hi Lee,

Looking at my boot file for SMSQmualtor/QPC2/Q-EMulator, I use this If clause:

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF
Seems to work for QDOS and SMSQ/E.

But I guess there are other solutions.
Thanks, but that would not work for me and perhaps I should clarify a little further.

Using Q-emuLator, my boot first loads SMSQ_QEM and restarts with the same boot

Where this

Code: Select all

IF VER$<>"HBA" THEN
   LRESPR "WIN8_SMSQ_QEM"
END IF


fails the second time around (as designed, so all good)

I then load (still in the same boot) the TURBO_SMS_CODE appropriate for SMSQ based system.

This is all fine, however, I am developing the boot for different setups and change them a lot depending on what project I decide to work on.

This means running the boot several times in the one session to test what I am trying to do and I don't want to keep using up space re-LRESPR the TURBO toolkit.
Using another toolkit to test for the existence of a keyword in the TURBO toolkit would then mean using another method to test for that additional Toolkit, as you said a catch 22.


So

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF

would not work for me :cry: .

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 2:03 pm
by Mr_Navigator
Thanks for all the suggestions guys

Code: Select all

220 IF TK_VER$<>"" THEN
230  PRINT "Done":STOP
240 ELSE
250  LRESPR win8_turbo_sms_code
260 END IF
this works exactly how I wanted it to, so congrats to Tobias.

I have also been able to get this method to work with TURBO ptr extensions as well by using the following

Code: Select all

220 IF ACR<>0 THEN
230  PRINT "Done":STOP
240 ELSE
250  LRESPR win2_tptr_ext
260 END IF
(ACR being a function within the TPTR_EXTs) So as to Derek's suggestion about other toolkits, this method could be adapted if suitable extension's functions allow.


I name this process either EORMT or RMTEO

(Run Many Times Execute Once)

I thankyou, I'm here 'til thursday, no wait, what!

Re: Testing for installed TURBO

Posted: Thu Aug 17, 2017 2:45 pm
by tofro
That method should work with any toolkit function that
  • does not require any parameters
  • can be relied upon to return anything different from 0 or an empty string in the default case
Toolkit II DATAD$ could be an example to test for Toolkit 2.

Tobias