I hacked a more accurate check. This one is a function.
I have tested in QBasic 1.1, QB4.5 and PDS 7.1, thats what I have.
In exes the function returns the version of the compiler used.
Anyone going further?
DECLARE FUNCTION qbversion% ()
CLS
SELECT CASE qbversion
CASE 1: PRINT "QBasic 1.0/1.1"
CASE 2: PRINT "QBasic 4.0/4.5"
CASE 3: PRINT "PDS 7.0/7.1"
CASE ELSE: PRINT "What happened?"
END SELECT
END
'a local error handler for all flavors of qb...
errorhandler: errata% = ERR: RESUME NEXT
FUNCTION qbversion%
'returns QuickBasic-QBasic version
'Antoni Gual agual@eic.ictnet.es
'Values returned: 1.- Qbasic
' 2.- QB 4.0-4.5
' 3.- PDS 7.0-7.1
'----------------------------------
SHARED errata%
ON ERROR GOTO errorhandler
ver% = 2
'next is bad syntax only in PDS
a& = FRE(-4)
IF errata% THEN
ver% = 3
ELSE
'COMMAND$ is handled in Qbasic 1.1 as advanced
'feature unavailable..
a$ = COMMAND$
IF errata% = 73 THEN
ver% = 1
END IF
END IF
qbversion% = ver%
ON ERROR GOTO 0
END FUNCTION
Antoni