🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.misc
Article #82

Re: Output formatting Question

#82
From: Dr John Stockton
Date: Sat, 15 Dec 2001 12:57
26 lines
2481 bytes
JRS:  In article <3C1A4B5C.40DD76DE@yahoo.com>, seen in news:borland.pub
lic.turbopascal, CBFalconer <cbfalconer@yahoo.com> wrote at Fri, 14 Dec
2001 19:07:39 :-
>  PROCEDURE write2digs(VAR f : text; n : integer)
>
>     BEGIN
>     n := abs(n);  /* just in case */
>     IF (n < 10) THEN write(f, '0', n : 1)
>     ELSE             write(f, n : 2);
>     END;

IMHO, a routine which can write a wrong value (because of abs) is most
undesirable.  Just make "n" a word.

>  PROCEDURE writedate(VAR f : text; dd, mm, yy, field: integer);
>  (* in ISO form yyyy-mm-dd with leading zeroes *)
<G>.  Alas, will not give leading year zeroes in the First Millennium -
though I doubt whether ISO-8601 requires that!

IMHO, a string function is more widely useful than a write procedure.
 
-- 
� John Stockton, Surrey, UK.  jrs@merlyn.demon.co.uk   Turnpike v4.00   MIME. �
 Web <URL: http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
 PAS EXE TXT ZIP via <URL: http://www.merlyn.demon.co.uk/programs/00index.htm>
 My DOS <URL: http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Technical Details
Message-ID: <Ssv4nFEOj0G8EwZV@merlyn.demon.co.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!merlyn.demon.co.uk!spam
References: <3C1A3235.5B88630E@marine.usf.edu> <3C1A4B5C.40DD76DE@yahoo.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 108ebd,4d112d056daac5d7
X-Google-Attributes: gid108ebd,public
X-Google-Thread: 111659,4d112d056daac5d7
X-Google-Attributes: gid111659,public
X-Google-Thread: 10261c,4d112d056daac5d7
X-Google-Attributes: gid10261c,public
X-Google-ArrivalTime: 2001-12-15 08:24:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!merlyn.demon.co.uk!spam
From: Dr John Stockton <spam@merlyn.demon.co.uk>
Newsgroups: comp.lang.pascal.misc,borland.public.turbopascal,comp.lang.pascal.borland
Subject: Re: Output formatting Question
Date: Sat, 15 Dec 2001 12:57:50 +0000
Organization: Home, 'Surrey', UK
Message-ID: <Ssv4nFEOj0G8EwZV@merlyn.demon.co.uk>
References: <3C1A3235.5B88630E@marine.usf.edu> <3C1A4B5C.40DD76DE@yahoo.com>
Reply-To: Dr John Stockton <reply@merlyn.demon.co.uk>
NNTP-Posting-Host: merlyn.demon.co.uk
X-NNTP-Posting-Host: merlyn.demon.co.uk:158.152.233.145
X-Trace: news.demon.co.uk 1008433413 nnrp-07:388 NO-IDENT merlyn.demon.co.uk:158.152.233.145
X-Complaints-To: abuse@demon.net
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain;charset=iso-8859-1
X-Newsreader: Turnpike (32) Version 4.00  <FaPHOaas0ellLCXbR0oIxSiVaE>
Lines: 26