Posts: 2,765
Threads: 138
Joined: Nov 2002
I am opening a file for output
Code:
OPEN "bob.txt" FOR OUTPUT AS #1
PRINT #1, "Hi wuts up?"
CLOSE #1
But when i make it an EXE using QB 4.5 it doesn't work.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,813
Threads: 284
Joined: Mar 2003
Maybe it's a sign that you aren't Jesus.
earn.
Posts: 2,765
Threads: 138
Joined: Nov 2002
You sure?
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 19
Threads: 3
Joined: May 2003
try write #1 instead of print #1
if somebody cuts of your hand you still have two sharp bones to stick in thier eyes"
Posts: 358
Threads: 15
Joined: May 2003
Quote:I am opening a file for output
Code:
OPEN "bob.txt" FOR OUTPUT AS #1
PRINT #1, "Hi wuts up?"
CLOSE #1
But when i make it an EXE using QB 4.5 it doesn't work.
Why not use instead:
OPEN "bob.txt" for BINARY AS 1
PUT 1, ,"Hi wuts up?"
close 1
and not worry about it? Also, if you are using an OPEN x FOR OUTPUT construct, why not use the WRITE 1, text instead of PRINT 1...? If you use the WRITE format instead of PRINT, the data will be comma deliminated...which is easier to read when you are retrieving your data.
cheers
Posts: 2,765
Threads: 138
Joined: Nov 2002
I tries it with binary but when i turn it into an EXE it doesn't work
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 358
Threads: 15
Joined: May 2003
Quote:I tries it with binary but when i turn it into an EXE it doesn't work
Whitetiger...I just compiled your original 3-line prog...works fine...I can read the test file no prob...FYI
Posts: 704
Threads: 0
Joined: Dec 2002
There's nothing wrong with that program as written. Are you absolutely sure *that's* the program you're trying to make an executable of? Humor me. Save your program. Let's say you called it "program.bas", for definitiveness. Open a DOS window. CD to the directory where that file is. Do
BC PROGRAM /O;
LINK PROGRAM;
If you don't get any error messages from BC or LINK, try running PROGRAM.
Now that I've typed all that, as I was typing the "/O", above, it occured to me that I should've asked what you meant by "doesn't work". Does the executable get made, or do you get compilation/LINK errors. If it gets errors when it runs, what errors did you get? (I'm wondering if the only problem is that you didn't make a stand-alone executable and your program can't find BRUN45.EXE.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 2,765
Threads: 138
Joined: Nov 2002
there were no errors. i bet that was it.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,288
Threads: 167
Joined: Nov 2001
I don't know but I think you should
cls
Screen 0