🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.pascal
Article #102

Re: Bug in 4.2 BSD Pascal implementation ???

#102
From: Bob Dietrich
Date: Mon, 08 Oct 1984 19:07
37 lines
2521 bytes
--------------
From the reply of Constantine Rasmussen at Pixel Computer Incorporated:

>>It seems that job of read is not to keep you out of the control 
>>characters but to only give you a printable char for whatever it was
>>that you did read, ie, a blank.

Read and the other Pascal I/O routines should NOT suppress control (i.e.,
non-printable) characters. The only exception to this is if end of line
is represented on your processor by such a character (or sequence of
characters). Some systems use an "invisible" count to specify how many
characters are in each line (and therefore where the end of line is).

One of the few differences between the ANSI/IEEE and ISO Pascal Standards is
that the former allows the end of line to be represented by a value of type
char, while the ISO standard prohibits this.

>>                ...  As I understand Pascal, if you want to get past
>>eoln the classic way is "readln;" without any arguments. ...

True, if you actually don't want to read anything further on the current
input line. Otherwise, readln can take arguments just like read.

>>Likewise, if you're interested in reading the real chars in a line,
>>don't use read but just "get" from the file pointer.

There should be absolutely no difference between doing "read(f, ch)" and
"ch := f^; get(f)". Again, control characters should not be suppressed
(although many file systems suppress ASCII nuls and many text editors make it
nearly impossible to enter most of the control characters).

                                              Bob Dietrich
                                              Tektronix, Inc.
                                              (503) 629-1727
{ucb or dec}vax!tektronix!robertd             uucp address
robertd@tektronix                             csnet address
robertd.tektronix@rand-relay                  arpa address
Technical Details
Message-ID: <3799@tektronix.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!robertd
References: <223@muddcs.UUCP>, <7@pixadv.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 (Tek) 9/26/83; site tektronix.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!robertd
From: robertd@tektronix.UUCP (Bob Dietrich)
Newsgroups: net.lang.pascal
Subject: Re: Bug in 4.2 BSD Pascal implementation ???
Message-ID: <3799@tektronix.UUCP>
Date: Mon, 8-Oct-84 15:07:58 EDT
Article-I.D.: tektroni.3799
Posted: Mon Oct  8 15:07:58 1984
Date-Received: Tue, 9-Oct-84 04:15:03 EDT
References: <223@muddcs.UUCP>, <7@pixadv.UUCP>
Organization: Tektronix, Beaverton OR
Lines: 37