Date : Wed, 15 Dec 1999 12:14:55 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Mode 7 file
Tim Strong <Tim@...> wrote:
> If I use *TYPE to try and redisplay the contents of this file, it hangs
> the machine (or emulator) very near the start. As far as I understand, the
*TYPE on a BBC B sends the full contents to the VDU. *TYPE on the Master
filters out control codes. It sounds like there's some control sequences
in it. *DUMPing it will show you what's actually in it. Try:
INP."Input file: "in$
in%=OPENIN(in$):IFin%=0:P."Can't open '"in$"'":END
REPEAT
A%=BGET#in%
IF A%>31 AND A%<>127:VDU A% ELSE IF A%=13 PRINT
UNTIL EOF#in%
CLOSE#in%:in%=0
You may have ANSI sequences in it which will look something like [12,34l;
[56k; sequences. I can post you a BBC ANSI Terminal that you can
redisplay a file through.
> Alternatively, does anyone have a simple program for stripping out control
> codes on a BBC and writing out to a different file, or will I have to
> re-learn BBC BASIC?! (Frustratingly I could easily do this on a PC but
> can't get the file into a readable ASCII format!)
You could try importing it into MSWord: File->Open->All files->select it.
Try this:
INP."Input file: "in$
in%=OPENIN(in$):IFin%=0:P."Can't open '"in$"'":END
INP."Output file: "out$
out%=OPENOUT(out$):IFout%=0:P."Can't open '"out$"'":CLOSE#in%:in%=0:END
REPEAT
A%=BGET#in%
IF A%>31 AND A%<>127:BPUT#out%,A% ELSE IF A%=13:BPUT#out%,A%
UNTIL EOF#in%
CLOSE#out%:out%=0
CLOSE#in%:in%=0
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ --- http://mdfs.net/