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

Re: 2 Applesoft BASIC questions/1 Hyper C question



In article <9406081756.AA25635@phy.mtu.edu>, smmcafee@phy.mtu.edu (Sean M. McAfee) writes:

[Some stuff deleted]

|>  5  ONERR  GOTO 100
|>  10 D$ =  CHR$ (4)
|>  20  PRINT D$;"OPEN XAA"
|>  30  PRINT D$;"READ XAA"
|>  40  PRINT D$;"OPEN XAA2"
|>  50  PRINT D$;"WRITE XAA2"
|>  60  GET A$
|>  70  IF A$ =  CHR$ (10) THEN  PRINT : GOTO 60
|>  80  PRINT A$;
|>  90  GOTO 60
|>  100  PRINT D$;"CLOSE"
|>  110  END 

[Lots more stuff deleted]

The problem with the above is the old open/read/open/write problem.
The way the program has to be written is:

10 d$=chr$(4)
15 print
20 onerr goto 120
30 print d$;"open xaa"
40 print d$;"read xaa"
50 print d$;"open xaa2"
60 print d$;"write xaa2"
70 print d$;"read xaa"
80 get a$
90 if a$=chr$(10) then a$=chr$(13)
95 print d$;"write xaa2"
100 print a$
110 goto 80
120 poke 216,0
130 print d$;"close"
140 end

You have to put a read statement before each section which deals with
reads and you have to put a write statement before each section which
deals with writes.  I've done this before also. :/
--------------------------------------------------------------------------------
DUE TO THE UPGRADING OF OUR COMPUTERS, YOU MUST NOW SEND ALL RESPONSES
TO mark@cliff.jsc.nasa.gov OR FACE THE BOUNCING MAIL GOD OF WRATH!
The sun shone upon her face, lighting my life with her grace.