AboutAlex Barry Expertise I have been a qbasic programmer since 2000, creating games, minor libraries and various small programs. I have experience using interrupts, graphics, file input/output, the mouse cursor, and using libraries. I have also learned FreeBASIC, c/c++, python, php and html.
I do not claim to be an absolute authority in any language, but I don't mind looking things up and learning with you.
Experience Hobby programming since 2000
I no longer belong to any community programming groups, but do have knowledge of *basic dialects and C/C++
QUESTION: Dear Alex,
I have some general questions today. Please help me with them:
1. How do you input only 1 character from the keyboard? I need the user to input only 'Y' or 'N'
2. How do you save program as .EXE in Qbasis 1.1(the version I have). If it can't be done in this version, can you provide some links to the newer versions?
ANSWER: Hi, Shane,
For question#1, you can use this code:
PRINT "Question? [Y/N] ";
DIM answer AS STRING * 1
answer = INPUT$(1)
answer = UCASE$( answer )
IF answer = "Y" then
' if the user selected yes....
ELSEIF answer = "N" then
' if the user selected no....
ELSE
' maybe some sort of error handling or maybe make a loop that will keep going until you type either Y or N
END IF
Question#2. Qbasic1.1 will not make executable files. The earliest most acceptable version of QBasic to do that is QB4.5 I think this link is active http://www.geocities.com/muratelic/qb45.htm
I think one of the links on there is dead, though, so you may have to do a little trial and error to get the download to work. Try and QBNZ link first.
I hope that answers everything, and helps you out,
Take care,
-Alex
---------- FOLLOW-UP ----------
QUESTION: Hi Alex,
Both the download links worked but on clicking, the program shows an error message. I've attached a screenshot and here's what it says:
"Invalid startup directory, please check your pif file. Choose 'Close' to terminate the application."
In the README file it says that:
"So no installation is required - simply unzip to wherever you want QuickBASIC to go. You may find you need to configure paths though - the "Set Paths" command is under the "Options" menu."
Since I can't even open the program, how do I configure the paths? Please help.
Answer Hi, Shane,
There might be a DOS shortcut in the directory (a pif file). If there is, delete it. Then try running the program.
If this doesn't work, it may be because you need to run this version of QuickBasic with DOSBox some other type of DOS emulation. What operating system are you using? I believe after Windows XP SP2, there are some major DOS incompatibilities that force you to use DOSBox or another DOS emulator.