Article View: news.software.readers
Article #141574[Dialog] Script to modify the Date column behavior
From: Antonio 'Gandalf' Favata
Date: Mon, 19 Jan 2004 01:22
Date: Mon, 19 Jan 2004 01:22
95 lines
4616 bytes
4616 bytes
news.software.readers ~ 18/01/04 20:10:52 ~ MLC:
> I rearranged that script inside a larger script of mines.
And I took the main idea from it to create a more customizable version,
I hope you'll forgive me for this theft ;)
Don't mind the warnings when you compile it, they're due to the boolean
variables I used to make it «configurable»... simply ignore them, it'll
work anyway.
Anybody can add this script to Dialog's Wiki if s/he finds it useful.
|| program OnArticleListPaint;
||
|| const
||
|| colDate = 3; //count your columns from left to right starting from 0
|| //and write here the number of the column Date;
||
|| removeYear = true; //set this to false if you don't want to remove the year
|| removeSeconds = true; //set this to false if you don't want to remove the seconds
|| removeLeading0s = true; //set this to false if you don't want to remove the leading
|| //zero from the day, month and hour strings
||
|| function OnArticleListPaint(PaintString:widestring;ColumnIndex:integer):widestring;
||
|| var
|| x: Integer;
|| tmpDate, tmpTime, day, month, year, h, m, s, dateSeparator, timeSeparator: WideString;
||
|| begin
||
|| case ColumnIndex of
|| colDate:
|| begin
|| x := pos(' ', paintstring);
||
|| tmpDate := copy(paintstring, 1, x-1);
|| tmpTime := copy(paintstring, x+1, 8);
||
||
||
|| day := copy(tmpDate, 1, 2);
|| if removeLeading0s and (copy(day, 1, 1) = '0') then
|| day := copy(day, 2, 1);
||
|| dateSeparator := copy(tmpDate, 3, 1);
|| // uncomment the following line to use your own separator
|| // dateSeparator := '~';
||
|| month := copy(tmpDate, 4, 2);
|| if removeLeading0s and (copy(month, 1, 1) = '0') then
|| month := copy(month, 2, 1);
||
|| year := copy(tmpDate, 7, x-6);
||
||
||
|| h := copy(tmpTime, 1, 2);
|| if removeLeading0s and (copy(h, 1, 1) = '0') then
|| h := copy(h, 2, 1);
||
|| timeSeparator := copy(tmpTime, 3, 1);
|| // uncomment the following line to use your own separator
|| // timeSeparator := '~';
||
|| m := copy(tmpTime, 4, 2);
|| s := copy(tmpTime, 7, 2);
||
||
|| paintstring := day + dateSeparator + month;
||
|| if not removeYear then
|| paintstring := paintstring + dateSeparator + year;
||
|| paintstring := paintstring + ' ' + h + timeSeparator + m;
||
|| if not removeSeconds then
|| paintstring := paintstring + timeSeparator + s;
||
|| end;
|| end; //case
||
|| result:=paintstring;
|| end;
||
|| begin
|| end.
Crossposted: news.software.readers, it.comp.software.newsreader
Followup-To: news.software.readers
--
Fare Well! | Freeware powerful newsreader with multilingual GUI
G | 40tude Dialog 2.0.10.1 ~ <http://snurl.com/dialog>
Technical Details
Message-ID:
<3e03byznq6op.dlg@shadowfax.ithn.invalid>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!news2.computerville.it!news.computerville.it!news.servidellagleba.it!not-for-mailReferences:
<16jk4x86rgg92$.dlg@coconino.nl> <wkdwnbaov1ug.mx23ia318zs4$.dlg@40tude.net> <1854n4rci62rw$.dlg@coconino.nl> <qw2qym20kem$.dlg@ID-187316.user.uni-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <3e03byznq6op.dlg@shadowfax.ithn.invalid> Subject: [Dialog] Script to modify the Date column behavior Date: Mon, 19 Jan 2004 02:22:37 +0100 From: Antonio 'Gandalf' Favata <gandalf@shadowfax.ithn.invalid> References: <16jk4x86rgg92$.dlg@coconino.nl> <wkdwnbaov1ug.mx23ia318zs4$.dlg@40tude.net> <1854n4rci62rw$.dlg@coconino.nl> <qw2qym20kem$.dlg@ID-187316.user.uni-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!news2.computerville.it!news.computerville.it!news.servidellagleba.it!not-for-mail Newsgroups: news.software.readers,it.comp.software.newsreader Followup-To: news.software.readers Organization: the White Council Lines: 95 Sender: gandalf@212.141.99.208 Reply-To: gandalf@ithn.net NNTP-Posting-Host: 212.141.99.208 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: megan.servidellagleba.it 1074475119 10235 212.141.99.208 (19 Jan 2004 X-Complaints-To: abuse@servidellagleba.it NNTP-Posting-Date: Mon, 19 Jan 2004 01:18:39 +0000 (UTC) User-Agent: 40tude_Dialog/2.0.10.60it (fe7ddeea.403.63) X-Face: &]^_njQjKuBI.th%)W1+ESkFY4E:r*#8}rkHLF'QTLo, >mql9aGkV*, v.-, qVdu&8Xk(6K