Greetings,
Does someone have a spare discourse upon BASIC, file and segmentation
sitting around somewhere? I'm in need of one.
I have a BASIC program I'm supposed to be fixing up. It has one underlying
log file used in all segments. In a few segments, it uses file 2. For
reading in CSMAN15, for writing in CSMAN16 and for reading in CSMAN21 and 22.
In one segment, it uses file 3 for writing. It's actually the CSMAN21 and 22
I want to ask about.
They used to be just CSMAN21, but the code got too big for a segment, so I
split them into two at a fairly natural divide. Unfortunately, the file #2
access happens in both segments. No problem, I thought, I'll add a
files #1,#2
at the beginning of CSMAN22 and all will be well. Not so. ATTEMPT TO READ
FROM WRITE-ONLY FILE (or something close to that). File reads fine in 21, dies
with that error on read in 22. Ok, so I went back to the only documentation I
have--the pocket guide. After some reading, it appeared that one of two
courses should gain me the solution. The first would be to change that
statement to
files #1,#4
and the read from #2 or else change the files statement in 21 to
files #1,*,*,*
assign my file-to-read to 4, change the files statment in 22 to
files #1,*,*,#4
and read from #4.
No luck in either case. In the first, I get the same ATTEMPT TO READ FROM
WRITE-ONLY FILE and in the second, I get ATTEMPT TO ACCESS UNOPENED FILE.
Any advice would be appreciated.
Thanks,
Ted
--
Ted Ashton ([log in to unmask]), Info Sys, Southern Adventist University
==========================================================
Invention is the mother of necessity.
-- Veblen, Thorstein (1857-1929)
==========================================================
Deep thoughts to be found at http://www.southern.edu/~ashted
|