Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding out QBASIC version 1

Status
Not open for further replies.

infinitysquadron

Programmer
Aug 2, 2002
20
CA
Is there a way for a program to detect which version of QBASIC it's being run on? So the user can be alerted if the program wont work on their version?
 
Oh yeah... (If you havn't figured it out yet,) this program returns "QB45" when running in any version of QB other then QB71, including "QB10" and "QBasic".
 
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
 
I think the problem of finding QB version is a nonsense.
After all no function will save us from having IDE parse errors before the program itself starts to run.
Any detector function should be used only in "politically correct" programs designed to pass thru any parser version or our function will be useless because never executed.

Antoni
 
Would it be ok for us to see the application in question? I think with a little work we could make it compile...
 
Thanks, agual! The main reason I wanted to know in the first place is because the program will not produce an error until after it's already running. Therefore I wanted to warn the user before this happened. I'll worry about trying to get it to compile when I'm actually done the program.

I've tried compiling 3 programs so far, 2 of which have failed. The third one was really simple, and I only compiled it to see if it would work. That leaves me with very little confidence in the QB Compiler! When I'm done this game, I'll put it up for download somewhere. I'll put you all in the credits too :) GOTO is the path to the Dark Side...
GOTO leads to disorganised programs...
Disorganised programs leads to unfinished programs...
Unfinished programs lead to suffering...
 
...All very true is what you have spoken. Unless you can safly contain your GOTO. Trap it. Use it. Then to the dark side you will not become.
 
Don't want to sound stupid, but can't you just check the date of creation and compare it to the release date. Or maybe check the readme files? I don't know what I am talking about, I just got Internet Today and this is the first thing ever I posted to, as of ... NOW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top