Article View: comp.sys.atari.st
Article #34784Re: Printing very long lines
From: Steve Kirkendall
Date: Sun, 30 Oct 1988 21:42
Date: Sun, 30 Oct 1988 21:42
33 lines
2077 bytes
2077 bytes
In article <9328@watdragon.waterloo.edu> wsflinn@violet.waterloo.edu (Scott Flinn) writes:
>
> The trick is that the picture is enhanced by printing each line
>3 times, which produces many overstruck characters. My own naive
>attempt to print this picture (basically using fgetc() and fputc(),
>or fgets() and fputs(), Bconout(), etc.) fails miserably. It prints the
>first pass of the line, some x's at the right and left margin, and
>ignores the remaining characters. Each line in the file has >200
>characters ... the characters which are overstruck on each line
>are simply separated by spaces (ascii 32's), not '\r's ... and each
>line ends with '\n'. What are the printing programs doing with
>these lines. Are they breaking them into 3 smaller '\r' separated
>lines (how do they know the line length)? I'm lost ... help.
Just a guess, but I'd say the file I/O functions in your compiler's library
are stripping out all carriage returns. Atari compilers usually do this to
convert text files from Atari format (Which ends each line with a
carriage-return/line-feed pair) to Unix format (which ends each line with just
a carriage-return) so that programs can be ported from UNIX to the ST more
easily.
You're going to have to disable this conversion by openning the file as a
"binary" file. With the old Megamax compiler, this is done by beginning the
file mode string with a 'b', as in:
fp = fopen("STARTREK.PIC", "br");
^-- Notice the 'b'
Hope that helps.
-- Steve Kirkendall
Technical Details
Message-ID:
<1170@psu-cs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!tektronix!reed!psu-cs!kirkendaReferences:
<9328@watdragon.waterloo.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!tektronix!reed!psu-cs!kirkenda From: kirkenda@psu-cs.UUCP (Steve Kirkendall) Newsgroups: comp.sys.atari.st Subject: Re: Printing very long lines Message-ID: <1170@psu-cs.UUCP> Date: 30 Oct 88 21:42:36 GMT References: <9328@watdragon.waterloo.edu> Reply-To: kirkenda@psu-cs.UUCP (Steve Kirkendall) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 33