-
01-02-08, 03:29 AM #1
File writing
I need help writing to a file that is running. I am programming in QBasic but any advice would be welcome (preferably debug for windows (which I understand is an assembler)). My programs are as follows:
...or...open [THISFILENAME$] for random as #1
while eof(1)=0
get #1
put #1
wend
close #1
The programs above do write to the file but I have to close down the program to see what has been written. I want the data to be written to the file, not simply to memory.open [THISFILENAME$] for random as #1
for address=1 to lof(1)
get #1, address
put #1, address
next address
close #1
-
01-02-08, 07:36 AM #2
According to my quickreference (since I don't program in QBasic) you are missing something out from the initial file open:
I couldn't tell you if this is helpful at all, from what I can work out, using the RANDOM file access allows both Read and Write at the same time, you could try writing to a file using APPEND or OUTPUT to see whether or not your syntax is correct. (That's what I would try anyhow)Code:OPEN [THISFILENAME$] for RANDOM AS #1 LEN = LEN(RecordVariable)
The only other possibility is that you are using the #1 for more than one file access at a time and this could cause conflicts on closing.
-
01-02-08, 07:53 AM #3
Stryder, thanks for your wise reply. However I get the same result when I use
open [THISFILE$] for random as #1 len=1
Similar Threads
-
By TruthSeeker in forum Business & EconomicsLast Post: 11-08-07, 04:17 PMReplies: 51
-
By darksidZz in forum Computer Science & CultureLast Post: 07-31-07, 11:16 AMReplies: 3
-
By Tiassa in forum Computer Science & CultureLast Post: 07-31-07, 11:02 AMReplies: 6
-
By coberst in forum General PhilosophyLast Post: 03-18-07, 03:51 PMReplies: 0
-
By MewSkitty in forum Computer Science & CultureLast Post: 01-20-07, 05:58 PMReplies: 20


Bookmarks