Article View: news.software.readers
Article #141594Re: [Dialog]
From: foxidrive
Date: Mon, 19 Jan 2004 09:29
Date: Mon, 19 Jan 2004 09:29
72 lines
4317 bytes
4317 bytes
On Sun, 18 Jan 2004 20:30:34 +0100, Frank Lekens wrote:
> Thanks anyway. The additional benefit of getting rid of the seconds is nice
If it is of interest this script modifies the date & time column and:
a) removes the century
b) removes the seconds
c) retains AM/PM indicators, if present.
d) pads the front of the date for day/month with only a single digit
e) pads the front of the time for hours that only have a single digit.
The latter two items are most noticeable with a monospaced/non proportional font, such as courier new.
It may not be pretty with a proportional font, so if you want to remove the padding then change
all three occurances of ' ' to ''.
It should handle many locale variations of day month yyyy or month day yyyy, with either single or double digits,
and also handle either military or civilian time, but YMMV.
Feel free to modify, spindle or mutilate. :)
program OnArticleListPaint;
// removes the century and seconds from the "date time" column.
// idx in the line following is the position of the date/time column
// on your screen counting from left to right (+/- column doesn't count)
const Idx=4;
var d:integer;
c:widestring;
am:widestring;
pm:widestring;
dpad:widestring;
function
OnArticleListPaint(PaintString:widestring;ColumnIndex:integer):widestring;
begin
am :='';
pm :='';
dpad :='';
begin
if ColumnIndex = Idx then
if copy(PaintString, length(PaintString)-2, 3) = ' AM' then am := ' AM';
if copy(paintstring, length(paintstring)-2, 3) = ' PM' then pm := ' PM';
c := copy(paintstring, 2, 1);
if (c = '/') or (c = '-') or (c = '.') then dpad := ' '
c := copy(paintstring, 4, 1);
if (c = '/') or (c = '-') or (c = '.') then dpad := dpad + ' '
for d:= 4 to 6 do
begin
c := copy(paintstring, d, 1);
if (c = '/') or (c = '-') or (c = '.') then
begin
PaintString := Copy(PaintString, 1, d) + Copy(PaintString, d+3, 8);
if copy(PaintString, length(PaintString),1) = ':' then
PaintString := copy(PaintString, 1, length(PaintString)-1);
PaintString := dpad + PaintString + am + pm;
if copy(PaintString, 11,1) = ':' then
PaintString := copy(PaintString, 1, 9) + ' ' + copy(PaintString, 10,length(PaintString)-9);
result := paintstring;
exit;
end;
end;
end;
result := paintstring;
end;
begin
end.
Technical Details
Message-ID:
<1dpqs1kbgpsde.2d2wz41wan7k$.dlg@40tude.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!feed2.news.rcn.net!rcn!news-out.cwix.com!newsfeed.cwix.com!news1.optus.net.au!optus!news.optus.net.au!53ab2750!not-for-mailReferences:
<16jk4x86rgg92$.dlg@coconino.nl> <wkdwnbaov1ug.mx23ia318zs4$.dlg@40tude.net> <1854n4rci62rw$.dlg@coconino.nl> <10gow37wesbhr$.dlg@ID-187316.user.uni-berlin.de> <zrin1f3t8eat$.dlg@coconino.nl>Show Full Headers
Complete Article Headers
Message-ID: <1dpqs1kbgpsde.2d2wz41wan7k$.dlg@40tude.net>
Subject: Re: [Dialog]
Date: Mon, 19 Jan 2004 09:29:10 GMT
From: foxidrive <foxidrive@Shotmail.com>
References: <16jk4x86rgg92$.dlg@coconino.nl> <wkdwnbaov1ug.mx23ia318zs4$.dlg@40tude.net> <1854n4rci62rw$.dlg@coconino.nl> <10gow37wesbhr$.dlg@ID-187316.user.uni-berlin.de> <zrin1f3t8eat$.dlg@coconino.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!feed2.news.rcn.net!rcn!news-out.cwix.com!newsfeed.cwix.com!news1.optus.net.au!optus!news.optus.net.au!53ab2750!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.10.1 (dbf4744d.322.167)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Face: ,C9+5-,tl2P/lP`;
cakJqFV\gH+G#W0'-Lv=V>t6AGNr]v#I0OP(s1vQKTHxfUbKjDTZ+ku x5\8h8)C{:;
Vsp5C{C'k<v!~ox#IOg*%^+
X-Original-NNTP-Posting-Host: 220.240.67.61
X-Original-Trace: 19 Jan 2004 20:29:09 +1100, 220.240.67.61
Lines: 72
NNTP-Posting-Host: 203.194.27.1
X-Complaints-To: abuse@comindico.com.au
X-Trace: news.optus.net.au 1074504550 203.194.27.1 (Mon,
NNTP-Posting-Date: Mon, 19 Jan 2004 20:29:10 EST
Organization: Comindico Australia - reports relating to abuse should be sent
to abuse@comindico.com.au