Testing for installed TURBO

Anything QL Software or Programming Related.
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Testing for installed TURBO

Post by janbredenbeek »

tofro wrote: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.
Unfortunately, if TK2 is not present then DATAD$ will be an unset variable and give an 'error in expression' error on QDOS/Minerva when trying to do anything with it in an expression. The only thing that could be done safely is using PRINT, which prints an asterisk with unset variables. You could PRINT DATAD$ to a file and then read it back, but that will probably create more problems than it's supposed to solve.
Another way to test for TK2, though less elegant, is testing if PEEK_L(164012) is nonzero (which is a pointer to the string that DATAD$ returns). Again this will fail on Minerva with second screen enabled; you could get around this by first testing VER$ and using PEEK_L(!!172) when it indicates a Minerva...

Jan.


Post Reply