[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple II text files (again)



<F0O@psuvm.psu.edu> writes:
>   Thanks everyone for your help, but unfortunately my routine still isn't
>working.  I'm using an apple IIe with Dos 3.3.  Below is a listing of
>the relevant parts of my program:
...
>100 INPUT "ENTER PRETEST DATE ";DT$
>110 INPUT "ENTER NAME OF OUTPUT FILE ";OF$
>130 PRINT D$;"OPEN ";FL$;",D1"
>132 PRINT D$;"APPEND ";OF$;",D2"
>140 PRINT D$;"READ ";FL$
>160 GET CH$
>170 LN$ = LN$ + CH$
>180 IF CH$ <> RT$ THEN GOTO 160
>210 PRINT D$;"WRITE ";OF$
>220 PRINT LN$
>222 GOTO 140
...
>   Ok, what happens is the print statements go out to the screen, instead
>of the disk file.  So does the write statement in line 210.
>So what I see is:
>   WRITE filename
>   Print statement output
>   Print statement output
>   If anyone has any idea what is wrong, please let me know.  This is
>driving me up the wall!

First let me state that I reserve the right to be entirely WRONG about
what I am going to say, since it has been many moons since I last tried
to do text file access in Applesoft BASIC.

Long, long ago in a galaxy far, far away...<waitananosecond, I'm
drifting off subject...>

What I'm attempting to say is that there is a problem with the GET
statement and file access under DOS 3.3.  The solution is to do the
following before each file access command (OPEN, READ, APPEND, WRITE,
CLOSE, etc.):

PRINT D$+CHR$(0)

That's right.  Print a NULL directly after a CONTROL-D.  DO NOT put a
semi-colon after it, do not attempt to append more commands after it
(except after a colon, perhaps.)  This somehow fixes the problem caused
by the GET command.

Once again, I reserve the right to be entirely wrong about this, but I
don't think I am.
-- 
Mike Crane     GEnie: M.CRANE   America Online: MIKE566
Internet: cranem@edsi.plexus.com, cranem@csystems.appleton.mil.wi.us,
          Michael_Crane@ntc.com, mike566@aol.com
"Who needs drugs...we've got UNIX!" - Me