Qbasic, Quickbasic/help

Advertisement


Question
Hello. I see you are an expert with qbasic, so i thought you sure were able to help me with my problem. See me and my friend are practicing for a competition and we got this program we just cant solve. We have to make a program which takes a string and makes the folder with that string as its name. But we do not know how to make a file inside that folder with the same program. The program should take a string and make a file with that string as its name inside the folder we made earlier. So if you can help us, please do :D

Answer
Hi, Faris,

It looks like there are 3 steps to this program.

First, you have to get the string name:

DIM UserInput AS STRING

INPUT "Name of folder and file: ", UserInput

Next, you have to create a folder.

In the QBasic help section, go into Index, and look up the MKDIR command.  It will tell you how to make folders with a specific name.

With the folder made, you'll have to make a file.  You'll want to look up the OPEN command in the help menu.  To open and create a file, there are a few sub-steps you'll have to figure out.

If you need specific help, if you show me some of your code, and I point you in the right direction.
-Alex

Qbasic, Quickbasic

All Answers


Answers by Expert:


Ask Experts

Volunteer


Alex 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, QB64, c/c++, python, lua, 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

I have been programming in *Basic dialects since 2000, as mentioned in my expertise. After a year of QBasic, I learned C and C++, and dabbled a little in ASM (I don't program in ASM - I literally just played around to see how things work). When QB64 and FreeBASIC were released, I played with those languages. At the time, FreeBASIC offered more functionality and I sided with that language for a while. During that time, while I was learning new languages, that I would see what scripting languages are available, where I took up python and lua. I started to notice a staleness to QB64's development (which I kept tabs on from time to time), and am now trying to be active in it's community and maybe in it's development in the future. Currently, I am only active on the QB64.net forums, but I appear on occasion on FreeBASIC.net's forums as well.

Education/Credentials
Highschool - 2007

©2012 About.com, a part of The New York Times Company. All rights reserved.