Re: Transfer a 8250 diskette

From: Spiro Trikaliotis <ml-cbmhackers_at_trikaliotis.net>
Date: Sat, 5 Nov 2011 19:05:14 +0100
Message-ID: <20111105180514.GU30372@trikaliotis.net>
Hello,

just to add what Nicolas already wrote (chr$(0)::

* On Sat, Nov 05, 2011 at 12:34:24PM +0100 r.lagendijk@hccnet.nl wrote:
 
> 
> 10 nm$="8032-700-asc-ns"
> 20 open 2,8,2,"1:"+nm$+",p,r"
> 30 open 3,9,3,"0:"+nm$+",p,w"
> 40 get#2,a$
> 50 if st=64 then goto 80

IIRC, this is wrong. ST=64 is set when you just read the last byte.
Thus, you end with a file that is one byte shorter than the original
one.

So, you have to "print#3,a$;" *before* doing the check in line 50.

thus, change it to:

45 print#3,a$;
50 if st=64 then goto 80
60 goto 40

Or, what is seen most often:

50 print#3,a$;
60 if st<>64 goto 80

> 60 print#3,a$;:goto 40
> 80 close 2:close 3
> 90 end

And don't forget to add something like

42 if a$="" then a$=chr$(0)

or similar logic.

Regards,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/

       Message was sent through the cbm-hackers mailing list
Received on 2011-11-05 19:00:03

Archive generated by hypermail 2.2.0.