🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #251758

Re: Excessive blank lines in Dialog

#251758
From: Bernd Rose
Date: Thu, 04 Oct 2012 05:21
72 lines
5175 bytes
On Wed, 3 Oct 2012 16:37:52 +0100, PeterC wrote:

[Script to remove consecutive blank quoted lines]
> Thank you for this. Eventually I dropped a script in to the Custom folder
> and found the Compile part in Dialog. Not sure if it's working 

No. This way it will not work. First, it needs to be an *Event* script.
And second, *.cds should be the compiled version (the uncompiled is *.ds).

You could move <Dialog Folder>\Scripts\Custom\OnBeforeSavingMessage.cds to
<Dialog Folder>\Scripts\Custom\OnBeforeSavingMessage.ds (note the change
in the extension) while Dialog is not running and - after starting Dialog -
got to the event scripts section to compile it. At least in case of an
event script I suggest doing it the "proper" way though:

Got to <Settings>-><Scripting>-><Scripting...>, switch to [Event scripts]
(a tab on the left side of the "Scripting" dialog) and select the entry
"OnBeforeSavingMessage". It should be there, even if it currently has no 
content. (There is only a finite number of event scripts with exactly
defined names. Therefore, Marcus created empty stubs for all of them.)

If you already have code inside OnBeforeSavingMessage, then it will show
black (with few other colors) in the right window pane. In this case you
need to insert the 50 lines of "Procedure TrimQLines" into the upper
part of "program OnBeforeSavingMessage". (Best scroll down till you find
the first "Procedure" or "Function" already there and insert the 50 lines
immediately before it. - Maybe with one empty line in between for better
readability of the code.) 

Afterwards, scroll down to the "procedure OnBeforeSavingMessage" and 
insert the "TrimQLines(Message);" line. If it isn't entirely clear to
you, where to insert this code, post "procedure OnBeforeSavingMessage"
here for advise.

It is likely, though, that you *don't* already have code for the event.
In this case, you'll see just two empty gray lines in the right window
pane stating:

// There currently exists no script for the selected
// event. Please select File>New to create it now.

In this case, follow the explanation of these two lines and execute
<File>-><New Script...>. (Be sure, that OnBeforeSavingMessage still
is selected while doing so.) *Replace* the whole code created in the
right window pane with the complete code I provided in my last
posting. Please note, that there is /no/ line wrap after "Servername:"!
Maybe it doesn't matter with PascalScript (it shouldn't), but better
make sure.

Whatever way you had to choose (inserting into existing code or
creating a new script), now you need to save (menu <File>-><Save>)
and compile (menu <Script>-><Compile>) the script. If no errors
show up, you can close the "Scripting" Dialog and see, if the 
script works as intended when loading new messages.

As a test, I suggest you to browse to a message with offending
blank lines. (Maybe the one you provided as an example.) Delete
the /body/ (not the whole message!) of that message (right mouse
menu or menu <Message>-><Delete Body>) and retrieve the body
anew by double clicking on the header. If all went well, the
script should provide fewer "pseudo-blank" lines.

> So far it looks as if > might have gone but >> or more are still there.

Although it doesn't matter until you have the script up and 
running: There will be lines with just quote characters left
(for better readability) after the script did its job. The
quote kept should show always the deepest quote level found
for consecutive pseudo-blank lines.
 
HTH.
Bernd
Technical Details
Message-ID: <3jv4pen16n21$.dlg@b.rose.tmpbox.news.arcor.de>
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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!multikabel.net!newsfeed20.multikabel.net!eweka.nl!lightspeed.eweka.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
References: <1givb5i5wmhfr.43akjwrkjzai.dlg@40tude.net> <k47764$4sm$1@news.albasani.net> <1qugc0d50ipjn$.1ul9jdnffldeu$.dlg@40tude.net> <16mlhe65uaaig$.dlg@b.rose.tmpbox.news.arcor.de> <hach34o0b9zb$.1sapq5uno78s0.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <3jv4pen16n21$.dlg@b.rose.tmpbox.news.arcor.de>
Subject: Re: Excessive blank lines in Dialog
Date: Thu, 4 Oct 2012 07:21:38 +0200
From: Bernd Rose <b.rose.tmpbox@expires-2012-10-31.arcornews.de>
References: <1givb5i5wmhfr.43akjwrkjzai.dlg@40tude.net> <k47764$4sm$1@news.albasani.net> <1qugc0d50ipjn$.1ul9jdnffldeu$.dlg@40tude.net> <16mlhe65uaaig$.dlg@b.rose.tmpbox.news.arcor.de> <hach34o0b9zb$.1sapq5uno78s0.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!multikabel.net!newsfeed20.multikabel.net!eweka.nl!lightspeed.eweka.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.15.41 (dbaf4a96.249.328)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Lines: 72
Organization: Arcor
NNTP-Posting-Date: 04 Oct 2012 07:21:39 CEST
NNTP-Posting-Host: 15d5ca17.newsspool1.arcor-online.net
X-Trace: DXC=^E[Mh[o0mBg:i=48;
 n?Z:`ic==]BZ:afn4Fo<]lROoRankgeX?EC@@`VFoD8oQ\:BdBYf[Tl<>RjjA^9P4;
 X\@^dcTYTdT\M8nd
X-Complaints-To: usenet-abuse@arcor.de