🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #378

Re: Too small field width

#378
From: Norman Diamond
Date: Wed, 26 Jul 1989 05:36
32 lines
1932 bytes
In article <8782@june.cs.washington.edu> pattis@june.cs.washington.edu (Richard Pattis) writes:

>In Pascal, when one specifies a too small field width, my compiler prints the
>"*" character replicated to fill the field width.

You don't have a Pascal compiler.  The Pascal standard (even the old
one; even J&W) calls for printing the value.

>My Modula-2 compiler
>prints the full value, in as few characters as possible, disregarding the
>field width if it is too small (0 is commonly used to mean "print the value
>in the fewest number of characters").

Like Pascal compilers do.  I'd suggest you return yours to the vendor
and demand a refund.  Warranty exclusions don't generally mention
blatant misrepresentation.

>Are there any languages/compilers out there that are known, in such a case,
>to keep the field width and print just some of value (for a number, either
>left or right truncated)? I thought FORTRAN IV did this, but the referece I
>have says no.  Maybe an earlier FORTRAN?

Fortran II did that.  Fortran IV printed stars.

I think you might be able to get truncation out of PL/I.

--
-- 
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net)
  The above opinions are inherited by your machine's init process (pid 1),
  after being disowned and orphaned.  However, if you see this at Waterloo or
  Anterior, then their administrators must have approved of these opinions.
Technical Details
Message-ID: <10607@riks.csl.sony.co.jp>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond
References: <8782@june.cs.washington.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond
From: diamond@csl.sony.co.jp (Norman Diamond)
Newsgroups: comp.lang.misc
Subject: Re: Too small field width
Message-ID: <10607@riks.csl.sony.co.jp>
Date: 26 Jul 89 05:36:38 GMT
References: <8782@june.cs.washington.edu>
Reply-To: diamond@riks. (Norman Diamond)
Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan
Lines: 32