QBASIC .dat files help
muplah wrote: For school we need to make a program that you input a name and it makes a .DAT file of the name you imputed. I have no idea what the open statement for this would be can someone please help.
Thanks, Muplah
wow I didn't know somebody was still writing qbasic, that's like win 95 language:D anyway maybe this will throw you in right direction:
INPUT Name$
OPEN "MyFile.dat" FOR OUTPUT AS #1
PRINT #1, Name$
CLOSE #1
http://www.colchsfc.ac.uk/computing/manuals/qbasic/QB09.htm
Also tell your teacher that a Dutch guy named "Spyware" told you that QBasic isn't the right way to get started with programming. Tell him you want to learn something useful, like Python. It's a great introduction language and you can actually apply it in real life. QBasic died many eons ago, and should be left alone.
Thanks Clone, but that will input the name in myfile.dat, our teacher is making us have something where it makes the .dat file as the name so it makes like paul.dat. Its weird and I am not sure if it is possible. And yeah no one uses qbasic(besides my teacher).
Spyware it seems like your link also is similar to Clone's examples it writing to studant.dat not depending on what you input. Which is what I need. And spyware I do not know python, but I agree qbasic should not be taught.
muplah wrote: Thanks Clone, but that will input the name in myfile.dat, our teacher is making us have something where it makes the .dat file as the name so it makes like paul.dat. Its weird and I am not sure if it is possible. And yeah no one uses qbasic(besides my teacher).
You will find quite often teachers are lazy and reuse projects. I can almost assure you its possible, and that he knows the answer to it.
OPEN sname$+".dat" FOR INPUT AS #1
Something like this. You have to combine a variable (the name part) and a string (.dat).
the code btw was just like from the first google link ;) I don't know qbasic, because well who does:) and I'm little too lazy to find out how you do that, but just put the input into a variable, and then find out how to create a new file. Usually it is just 'opening' new file for writing. It is fairly easy task, google should answer most of your queries from this point ;)
or look above:)
let me take a line straight from you bloody profile
About User I own approximately 6.8% of shoutbox posts.
So please STFU about spamming. Please crawl back under your god damn rock and eat the turd that is coming out of your ass because you are so full of shit.
Learn what you are actually writing about before you do so you do not look like a total idiot like here.
So please learn to lay off and get your shit together so that you can ensure that i does not back fire on you. And I know you will come back with some small "belittling" remark that you think you will get away with. However, you do not know that no matter what you are typing on HBH, it means nothing in life. Learn…do not burn your bridges that you cannot see. They could hinder your escape from the real world in the future. So please….STFU spammer.
spyware wrote: [quote]**AldarHawk wrote:**Text
Aldarhawk, you can't flame for shit. Really, you shouldn't even attempt to flame. I'm sorry man, it's just not your thing :/
Also, it might have something to do with your current BAC level.[/quote]
nope. just got tired of his shit…nothing more. But thank you for your normal brutal honesty once again…now you are back :D