🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mush
Article #463

Re: The hdr_format variable

#463
From: Barton E. Schaefer
Date: Tue, 31 Jul 1990 14:57
25 lines
1288 bytes
On Jul 30, 12:54pm, Chris Wooff wrote:
} Subject: The hdr_format variable
}
} I'd like hdr_format to include a date in the form ddMMMyy, e.g. 01Aug90.
} %2N%3M%y almost gives me what I want. However, the above date prints
} as 1 Aug90. Is there some easy way in which I can force the leading zero?

No, but you can get a leading rather than trailing space on the %N.

The default in mush is to left-justify hdr_format fields.  So in a sort
of reversal on printf, mush will right-justify if you specify a negative
field width.  To wit:

    %-2N%3M%y

will produce " 1Aug90" and "27Jul90" instead of "1 Aug90" and "27Jul90".
This at least has the right width for the rest of your formatting and
looks less ragged.

Unfortunately, mush uses atoi() on the field width specifiers as it
reads them, so it currently does not recognize leading 0s to specify
zero-padding.

-- 
Bart Schaefer						schaefer@cse.ogi.edu
Technical Details
Message-ID: <9007311457.AA14012@cse.ogi.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!bloom-beacon!CSE.OGI.EDU!schaefer

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!bloom-beacon!CSE.OGI.EDU!schaefer
From: schaefer@CSE.OGI.EDU (Barton E. Schaefer)
Newsgroups: comp.mail.mush
Subject: Re: The hdr_format variable
Message-ID: <9007311457.AA14012@cse.ogi.edu>
Date: 31 Jul 90 14:57:37 GMT
Sender: daemon@athena.mit.edu (Mr Background)
Organization: The Internet
Lines: 25