🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
19 messages
19 total messages Started by Ron Ford Thu, 03 Jul 2008 00:45
[dialog] re-installation
#222794
Author: Ron Ford
Date: Thu, 03 Jul 2008 00:45
22 lines
1618 bytes
Hello ng,

I'm on the other side of an OS install during which I was able to put
dialog's files on a memory stick and use them on others' machines.  This
dialog install is in a folder on my desktop, and I thought I would solicit
comment as to how to get my install in a good place so that I can--I
hope--forget about newsreader issues for a while to concentrate on other
matters.

I'll just start my questions shotgun-style:
1)  I never bothered to update my executable.  Is 4d2b38 the latest?

2)  I have no idea what my server settings with NIN were as it regards
newsgroups.  Given that I can +read news with dialog, can I 
find these settin 's.

3)  Keboa+grd mal
functioniny

+Ron 
Fo+rd
Re: [dialog] re-installation
#222797
Author: Beauregard T. Shagnasty
Date: Thu, 03 Jul 2008 01:24
13 lines
1887 bytes
Ron Ford wrote:

> 1)  I never bothered to update my executable.  Is 4d2b38 the latest?

No. 
http://dialog.datalist.org/downloads/download.html

Get:  (dialog.84.zip) Dialog.exe 2.0.15.84 update
and replace the executable with this one.

-- 
   -bts
   -Friends don't let friends drive Windows
Re: [dialog] re-installation
#222801
Author: Ron Ford
Date: Thu, 03 Jul 2008 02:44
35 lines
2349 bytes
On Wed, 2 Jul 2008 21:24:18 -0400, Beauregard T. Shagnasty posted:

> Ron Ford wrote:
> 
>> 1)  I never bothered to update my executable.  Is 4d2b38 the latest?
> 
> No. 
> http://dialog.datalist.org/downloads/download.html
> 
> Get:  (dialog.84.zip) Dialog.exe 2.0.15.84 update
> and replace the executable with this one.

Am replying with the new executable.  I downloaded it into the dialog
folder I created on my desktop.  I extracted it there and, so far, have no
trouble with dialog.exe existing in two subfolders: one in which it was
unzipped, the other in 40tude's root.

Also am replying with my usual keyboard and mouse.  My PS/2 counterparts
have seen a lot of action and have quirks.  I'll continue to ask questions.

3)  My sig files don't seem to have survived the transfer.  My guess is
that they're hard-coded after the first specification.  I'll try to provide
the answer to this one myself.

4)  (Especially for Bernd bzw. Oliver)  Can I use mtr.exe to count the the
number of files that I have currently in 40tude's root install?

5)  I get deja vu all over again whenever I read Beauregard's posts.  Is it
possible that that was the name of a cartoon cat?  (Thanks for your reply,
too.)

-- 
Ron Ford
"The USA: where the Supremes think we don't have enough violence in D.C."
Scheisskatholiken.
Re: [dialog] re-installation
#222802
Author: Rom
Date: Thu, 03 Jul 2008 02:46
18 lines
1702 bytes
On Wed, 2 Jul 2008 17:45:31 -0700, Ron Ford wrote:

> 1)  I never bothered to update my executable.  Is 4d2b38 the latest?

2.0.15.41 or 2.0.15.84 are better than 2.0.15.1 you're using.

> 2)  I have no idea what my server settings with NIN were as it regards
> newsgroups.  Given that I can +read news with dialog, can I 
> find these settin 's.

Yep, either from the email sent to you by NIN, or see the NIN web site
for server config and perhaps contact them if password forgotten, or
try Snadboy's Revelation <http://www.snadboy.com/> (works on
Win9x/2k/XP/Vista) or similar, on the password asterisks in Dialog:
Settings > Server, Identities, Signatures > Newsservers > NIN/whatever

-- 
Rom
Re: [dialog] re-installation
#222803
Author: Beauregard T. Shagnasty
Date: Thu, 03 Jul 2008 03:22
11 lines
1902 bytes
Ron Ford wrote:

> 5)  I get deja vu all over again whenever I read Beauregard's posts. 
> Is it possible that that was the name of a cartoon cat?  (Thanks for
> your reply, too.)

No cartoon cat that I am aware of...

-- 
   -bts
   -Friends don't let friends drive Windows
Re: [dialog] re-installation
#222804
Author: Ron Ford
Date: Thu, 03 Jul 2008 03:43
41 lines
2824 bytes
On Thu, 3 Jul 2008 12:46:52 +1000, Rom posted:

> On Wed, 2 Jul 2008 17:45:31 -0700, Ron Ford wrote:
> 
>> 1)  I never bothered to update my executable.  Is 4d2b38 the latest?
> 
> 2.0.15.41 or 2.0.15.84 are better than 2.0.15.1 you're using.
> 
>> 2)  I have no idea what my server settings with NIN were as it regards
>> newsgroups.  Given that I can +read news with dialog, can I 
>> find these settin 's.
> 
> Yep, either from the email sent to you by NIN, or see the NIN web site
> for server config and perhaps contact them if password forgotten, or
> try Snadboy's Revelation <http://www.snadboy.com/> (works on
> Win9x/2k/XP/Vista) or similar, on the password asterisks in Dialog:
> Settings > Server, Identities, Signatures > Newsservers > NIN/whatever

Thanks, Rom, it works like a charm.  I made a screen capture of the
revealed password and saved that to the root menu of dialog.

I did not have the e-mail that NIN sent me as that was in OE, which has
been a non-starter for archiving with me.  Old OS is gone implies that
everything having to do with OE is as well.  I was pleased that I was able
to get e-mail messages using dialog, which brings up more questions:

6)  How do I configure dialog to emulate OE's capability to check for
messages on start-up and then every 30 minutes thereafter?  This is alikely
to be a question covered in the .chm help, so a reference thereto would
suffice.

7)  Do you know what this other product was at snadboy?  Revelation works
so well that I'm intrested in whatever else this fellow may vend, asking
only for tips.

8) It's midwinter in Ozzie land.  Does the sun, in its daily course, appear
north of the arc described by overhead, directly east and directly west?

Cheers,

Ron Ford
Re: [dialog] re-installation
#222814
Author: Eggs Zachtly
Date: Thu, 03 Jul 2008 09:08
18 lines
2024 bytes
Ron Ford said:

[...]
> 
> 6)  How do I configure dialog to emulate OE's capability to check for
> messages on start-up and then every 30 minutes thereafter?  This is alikely
> to be a question covered in the .chm help, so a reference thereto would
> suffice.

http://www.40tude.com/dialog/wiki/index.php/ScriptFetchByInterval

[rest snipped]

-- 

Eggs

Photons have mass? I didn't even know they were Catholic.
Re: [dialog] re-installation
#222824
Author: Ron Ford
Date: Thu, 03 Jul 2008 21:35
59 lines
2414 bytes
On Thu, 3 Jul 2008 04:08:57 -0500, Eggs Zachtly posted:

> Ron Ford said:
> 
> [...]
>> 
>> 6)  How do I configure dialog to emulate OE's capability to check for
>> messages on start-up and then every 30 minutes thereafter?  This is alikely
>> to be a question covered in the .chm help, so a reference thereto would
>> suffice.
> 
> http://www.40tude.com/dialog/wiki/index.php/ScriptFetchByInterval

Thanks, Eggs.  I thought I was out of my depth on this one but I think that
I got it.

I pasted the bodies of the following into the event scripts:

program OnStartup;
procedure OnStartup;
begin
ADo('GetNewHeadersInSubscribedGroups');
ADo('GetNewEmailsForAllIdentities');
//Mails
timer1.interval:=60000*5;
timer1.enabled:=true;
//News
timer2.interval:=60000*30;
timer2.enabled:=true;
end;
begin
end.
And the second part for OnTimer1 (getting the mails): 

program OnTimer1;

procedure OnTimer1;
begin
ADo('GetNewEmailsForAllIdentities');
end;

begin
end.
And the third part for OnTimer2 (getting the news): 

program OnTimer2;
procedure OnTimer2;
begin
ADo('GetNewHeadersInSubscribedGroups');
end;
begin
end.

I then compiled OnStartup, and voila, it retrieved my e-mails and new
headers.  What is the purpose of the extra 
begin
end.
in all these scripts?
-- 
Re: [dialog] re-installation
#222827
Author: Ron Ford
Date: Thu, 03 Jul 2008 22:42
21 lines
1799 bytes
On Wed, 2 Jul 2008 19:44:28 -0700, Ron Ford posted:

> On Wed, 2 Jul 2008 21:24:18 -0400, Beauregard T. Shagnasty posted:
> 
>> Ron Ford wrote:
>> 

> 3)  My sig files don't seem to have survived the transfer.  My guess is
> that they're hard-coded after the first specification.  I'll try to provide
> the answer to this one myself.

This is hard-coded in a way that doesn't lend itself to being moved around,
currently with:

C:\Documents and Settings\dan\Desktop\dialog\40tude Dialog\data\sigs2.txt

Can this be changed to a path that is relative to the 40tude root?
-- 
The urge to save humanity is almost always a false front for the urge to
rule.
H. L. Mencken
Re: [dialog] re-installation
#222825
Author: Eggs Zachtly
Date: Thu, 03 Jul 2008 22:51
22 lines
2206 bytes
Ron Ford said:

[...]

> I then compiled OnStartup, and voila, it retrieved my e-mails and new
> headers.  

If you haven't figured it out, you can change the interval for the timer
(each 60000=1 minute).

> What is the purpose of the extra 
> begin
> end.
> in all these scripts?

Beats the crap outta me. They gotta be there, though.  =)  I'd suppose it
has to do with the multiple scripts working in conjunction with each other.
-- 

Eggs

A fine is a tax for doing wrong. A tax is a fine for doing well.
Re: [dialog] re-installation
#222853
Author: Eggs Zachtly
Date: Fri, 04 Jul 2008 08:37
29 lines
2478 bytes

> Ron Ford said:
> 
> [...]
> 
>> I then compiled OnStartup, and voila, it retrieved my e-mails and new
>> headers.  
> 
> If you haven't figured it out, you can change the interval for the timer
> (each 60000=1 minute).
> 
>> What is the purpose of the extra 
>> begin
>> end.
>> in all these scripts?
> 
> Beats the crap outta me. They gotta be there, though.  =)  I'd suppose it
> has to do with the multiple scripts working in conjunction with each other.

On further contemplation, I think the 'extra' begin/end isn't "extra" at
all. The first set defines the script, and the set at the end, tells the
script to execute. That's my story, and I'm sticking to it.  =)

-- 

Eggs

Do cemetery workers prefer the graveyard shift?
Re: [dialog] re-installation
#222866
Author: Ron Ford
Date: Fri, 04 Jul 2008 20:14
52 lines
2477 bytes
On Fri, 4 Jul 2008 03:37:07 -0500, Eggs Zachtly posted:

>> Ron Ford said:
>> 
>> [...]
>> 
>>> I then compiled OnStartup, and voila, it retrieved my e-mails and new
>>> headers.  
>> 
>> If you haven't figured it out, you can change the interval for the timer
>> (each 60000=1 minute).

Units are then milliseconds.
>> 
>>> What is the purpose of the extra 
>>> begin
>>> end.
>>> in all these scripts?
>> 
>> Beats the crap outta me. They gotta be there, though.  =)  I'd suppose it
>> has to do with the multiple scripts working in conjunction with each other.
> 
> On further contemplation, I think the 'extra' begin/end isn't "extra" at
> all. The first set defines the script, and the set at the end, tells the
> script to execute. That's my story, and I'm sticking to it.  =)

They all have the same form:

program OnTimer1;

procedure OnTimer1;
begin
ADo('GetNewEmailsForAllIdentities');
end;

begin
end.


program OnEvent;
procedure OnEvent;
begin
#do something;
end;
begin
end.

I wonder what other dialog scripts do people have that they like?

-- 
Life is a constant oscillation between the sharp horns of dilemmas.
H. L. Mencken
Re: [dialog] re-installation
#222865
Author: Eggs Zachtly
Date: Fri, 04 Jul 2008 20:35
20 lines
2366 bytes
Ron Ford said:

[...]

> I wonder what other dialog scripts do people have that they like?

Personally, I've loaded:

KennyRotMorseTranslator  (pretty much self-eggsplanatory)
Showhelp  (button - makes chm open full screen by default)
OnNewsgroupListPaint   (renames newsgroups in groups pane)
OnBeforeSendingMessage - date/time  (this may be a default, been too long)

I think the rest loaded are defaults. Again, been a few years since I've
added any.
-- 

Eggs

Do Lipton employees take coffee breaks?
Re: [dialog] re-installation
#222909
Author: Ron Ford
Date: Sun, 06 Jul 2008 00:19
1425 lines
45323 bytes
On Fri, 4 Jul 2008 15:35:11 -0500, Eggs Zachtly posted:

> Ron Ford said:
> 
> [...]
> 
>> I wonder what other dialog scripts do people have that they like?
> 
> Personally, I've loaded:
> 
> KennyRotMorseTranslator  (pretty much self-eggsplanatory)
> Showhelp  (button - makes chm open full screen by default)
> OnNewsgroupListPaint   (renames newsgroups in groups pane)
> OnBeforeSendingMessage - date/time  (this may be a default, been too long)
> 
> I think the rest loaded are defaults. Again, been a few years since I've
> added any.

This is huge:

Program Kenny_Mirror_Hex_Rot13_Morse_Base64_Translater;

{ Version 4 Date: 2004/10/15 - 20:37
  compile and run with Dialog version 2.0.14.1 (Beta 37)
  Check the source code or save your data before use.}


uses
   Forms, StdCtrls;

CONST
   LetterSeparator = ' ';
   WordSeparator = '  ';



VAR
   CoderForm : TForm;
   CoderMemo : TMemo;
   CoderBtQuit : TButton;
   Rot13Bt : TButton;
   FromKennyBt :TButton;
   FromMorseBt : TButton;
   IntoKenny : TButton;
   IntoMorse : TButton;
   MirrorBt : TButton;
   RoRrImBT : TButton; 
   IntoHexBt : TButton;
   FromHexBt : TButton;
   IntoBase64Bt : TButton;
   FromBase64Bt : TButton;
   ClearMemoBt : TButton;
   ChangeFKBt : TButton;
   IntoLFBt : TButton;
   FromLFBt : TButton;
   Free1Bt : TButton;
   Free2Bt : TButton;
   CodeMorse : TstringList;
   CodeLetter:  TstringList;
   Index : INTEGER;
   CodeLine : String;
   EqualPos : INTEGER;

   FUNCTION DecodeMorseWords(MorseWord : String) : String;

   VAR
      LetterSeparatorPos : INTEGER;
      MorseChar : string;

   BEGIN  {DecodeMorseWords}
      Result := '';
      LetterSeparatorPos := Pos(LetterSeparator, MorseWord);
      WHILE  LetterSeparatorPos > 0 DO
      BEGIN
         MorseChar := Copy(MorseWord,1, LetterSeparatorPos-1);
         delete(MorseWord,1, LetterSeparatorPos);
         IF CodeLetter.IndexOfName(MorseChar) = -1 THEN
            Result := Result + MorseChar
         ELSE
         BEGIN
            Result := Result +  CodeLetter.Values[MorseChar];
            IF CodeLetter.Values[MorseChar] = 'SOS' THEN
               Result := Result+' ';
         END;
         LetterSeparatorPos := Pos(LetterSeparator, MorseWord);
      END;
      IF MorseWord > '' THEN
         IF CodeLetter.IndexOfName(MorseWord) = -1 THEN
            Result := Result + MorseWord
         ELSE
            Result := Result +   CodeLetter.Values[MorseWord];
      Result := Result +' ';
   END;   {DecodeMorseWords}

   FUNCTION DecodeMorseLine(Line : String) : String;

   VAR
      WordBuffer : string;
      WordSeparatorPos : INTEGER;
      Index : INTEGER;
   BEGIN
      Result := '';
      FOR Index := Length(Line) DOWNTO 1 DO
      BEGIN
         IF (Line[index] < ' ') THEN
            Insert(' ', line, index+1);
      END;
      WordSeparatorPos := POS(WordSeparator, Line);
      WHILE WordSeparatorPos > 0 DO
      BEGIN
         WordBuffer := Copy(Line,1, WordSeparatorPos-1);
         delete(Line,1, WordSeparatorPos);
         Result := Result + DecodeMorseWords(WordBuffer);
         WordSeparatorPos := Pos(WordSeparator, Line);
      END;
      IF Line > '' THEN
         Result := Result +   DecodeMorseWords(Line);
   END; {DecodeMorseLine}

   PROCEDURE NormalizeLineFeed(VAR Source : string);

   VAR
      LineSeparatorPos : INTEGER;

   BEGIN
      {normalize line feed (#10, #13#10, #10#13,#13 to #13}
      LineSeparatorPos := POS(#10, Source);
      WHILE LineSeparatorPos > 0 DO
      BEGIN
         delete(Source, LineSeparatorPos, 1);
         insert(#13, Source, LineSeparatorPos);
         LineSeparatorPos := POS(#10, Source);
      END;
      LineSeparatorPos := POS(#13#13, Source);
      WHILE LineSeparatorPos > 0 DO
      BEGIN
         delete(Source, LineSeparatorPos, 1);
         LineSeparatorPos := POS(#13#13, Source);
      END;
   END;

   FUNCTION DecodeMorse(Source : string) :string;

   VAR
      Line : String;
      LineSeparatorPos : INTEGER;


   BEGIN
      Result := '';
      NormalizeLineFeed(Source);
      LineSeparatorPos := POS(#13, Source);
      WHILE LineSeparatorPos > 0 DO
      BEGIN
         Line := Copy(Source,1, LineSeparatorPos-1);
         Result := Result + DecodeMorseLine(Line);
         delete(Source, 1, LineSeparatorPos);
         Result := Result +#13#10;
         LineSeparatorPos := POS(#13, Source);
      END;
      IF Source > '' THEN
         Result := Result +  DecodeMorseLine(Source);
   END;

   PROCEDURE BitBtMorseToTextClick(Sender: TObject);

   VAR
      DecodeBuffer : string;
      LengthBuffer : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      DecodeBuffer := CoderMemo.SelText;
      LengthBuffer := Length(DecodeBuffer);
      IF LengthBuffer > 1 THEN
      BEGIN
      {replace space at the beginning or / and at the end of morsestring by
my morse wordseparator}
         IF (DecodeBuffer[LengthBuffer] = ' ') AND
(DecodeBuffer[LengthBuffer-1] <> '/') THEN
            DecodeBuffer := DecodeBuffer +'/ ';
         IF (DecodeBuffer[1] = ' ') AND (DecodeBuffer[2] <> '/') THEN
            DecodeBuffer := ' /'+ DecodeBuffer;
      END;
      CoderMemo.SelText := DecodeMorse(DecodeBuffer);
      CoderMemo.SetFocus;
   END;

   FUNCTION CodeTextWord( TextWord : String): STRING;

   BEGIN
      Result := '';
      WHILE TextWord > '' DO
         IF TextWord = 'SOS' THEN
         BEGIN
            Result := Result +  CodeMorse.Values['SOS'];
            TextWord := '';
         END
         ELSE
         IF CodeMorse.IndexOfName(TextWord[1]) = -1 THEN
         {Not a morse code}
         BEGIN
            IF TextWord[1] >= ' ' THEN
            {printable char}
               Result := Result + TextWord[1]+' '
            ELSE
               Result := Result + TextWord[1];
            delete(TextWord, 1, 1);
         END
         ELSE
         BEGIN
            Result := Result +  CodeMorse.Values[TextWord[1]]+' ';
            delete(TextWord, 1, 1)
         END
   END;

   FUNCTION CodeTextLine(TextLine : String) : String;

   VAR
      WordBuffer : STRING;
      WordSeparatorPos : INTEGER;

   BEGIN
      Result := '';
      WordSeparatorPos :=  POS(' ', TextLine) ;
      WHILE WordSeparatorPos > 0 DO
      BEGIN
         IF Pos(' / ', TextLine) = 1 THEN
         BEGIN
            Result := Result + CodeMorse.Values[' / '];
            delete(TextLine, 1, 3);
         END
         ELSE
         BEGIN
            WordBuffer := Copy(TextLine, 1, WordSeparatorPos-1);
            Result := Result + CodeTextWord(WordBuffer)+' ';
            Delete(TextLine, 1 ,WordSeparatorPos);
         END;
         WordSeparatorPos :=  POS(' ', TextLine) ;
      END;
      IF TextLine > '' THEN
         Result := Result+ CodeTextWord(TextLine);
   END;

   FUNCTION CodeToMorse(Source : string) :string;

   VAR
      LineSeparatorPos : INTEGER;
      Line : String;
   BEGIN
      Result := '';
      Source := UpperCase(Source);
      {normilize linefeed}
      NormalizeLineFeed(Source);
      LineSeparatorPos := pos(#13, Source);
      WHILE LineSeparatorPos > 0 DO
      BEGIN
         Line := Copy(Source, 1, LineSeparatorPos-1);
         result := result + CodeTextLine(Line)+ #13#10;
         delete(Source, 1,LineSeparatorPos);
         LineSeparatorPos := pos(#13, Source);
      END;
      IF Source > '' THEN
         result := result + CodeTextLine(Source)+ #13#10;
   END;

   PROCEDURE BitBtTextToMorseClick(Sender: TObject);

   VAR
      CodeBuffer : String;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      CodeBuffer := CoderMemo.SelText;
      CoderMemo.SelText := CodeToMorse(CodeBuffer);
      CoderMemo.SetFocus;      
   END;

   FUNCTION KennyToNormal (Source : string ): string;

   BEGIN
      CASE Source[1] OF
         'm':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 'a';
               'p': result := 'b';
               'f': result := 'c';
            END; {Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'd';
               'p': result := 'e';
               'f': result := 'f';
            END; {Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'g';
               'p': result := 'h';
               'f': result := 'i';
            END;  {Source[3]}
         END;{Source[2]}
         'p':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 'j';
               'p': result := 'k';
               'f': result := 'l';
            END;{Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'm';
               'p': result := 'n';
               'f': result := 'o';
            END; {Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'p';
               'p': result := 'q';
               'f': result := 'r';
            END; {Source[3]}
         END; {Source[2]}
         'f':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 's';
               'p': result := 't';
               'f': result := 'u';
            END;{Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'v';
               'p': result := 'w';
               'f': result := 'x';
            END; {Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'y';
               'p': result := 'z';
            END; {Source[3]}
         END; {Source[2]}
         'M':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 'A';
               'p': result := 'B';
               'f': result := 'C';
            END; {Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'D';
               'p': result := 'E';
               'f': result := 'F';
            END; {Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'G';
               'p': result := 'H';
               'f': result := 'I';
            END; {Source[3]}
         END; {Source[2]}
         'P':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 'J';
               'p': result := 'K';
               'f': result := 'L';
            END; {Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'M';
               'p': result := 'N';
               'f': result := 'O';
            END;{Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'P';
               'p': result := 'Q';
               'f': result := 'R';
            END; {Source[3]}
         END; {Source[2]}
         'F':
         CASE Source[2] OF
            'm':
            CASE Source[3] OF
               'm': result := 'S';
               'p': result := 'T';
               'f': result := 'U';
            END;{Source[3]}
            'p':
            CASE Source[3] OF
               'm': result := 'V';
               'p': result := 'W';
               'f': result := 'X';
            END; {Source[3]}
            'f':
            CASE Source[3] OF
               'm': result := 'Y';
               'p': result := 'Z';
            END; {Source[3]}
         END {Source[2]}
      END {Source[1]}
   END;

   PROCEDURE BitBtKennyToNormalClick(Sender: TObject);

   VAR
      Index : INTEGER;
      SelBuffer : String;
      TestBuffer : STRING;


   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      SelBuffer := CoderMemo.SelText;
      {IF Kenny was decoded from Morse, only uppercase letter
       are in the code when no triplet has the last two letter
       uppercase. It allows a multiple coding translation like
       rot13 + Kenny+Rot13+Morse and recerse.
       It is not possible to restore exactly the initial sentence
       but it is readable ;-) }

       {Start uppercase translation at the end of the string}
      Index := Length(SelBuffer)-2;
      WHILE Index > 0  DO
      BEGIN
         {copy triplet}
         TestBuffer := Copy(Selbuffer,Index,3);
         {is Triplet a kenny triplet}
         IF ((TestBuffer[1] = 'F')
            OR (TestBuffer[1] = 'M')
            OR (TestBuffer[1] = 'P')
            OR (TestBuffer[1] = 'f')
            OR (TestBuffer[1] = 'm')
            OR (TestBuffer[1] = 'p'))
         AND
            ((TestBuffer[2] = 'F')
            OR (TestBuffer[2] = 'M')
            OR (TestBuffer[2] = 'P')
            OR (TestBuffer[2] = 'f')
            OR (TestBuffer[2] = 'm')
            OR (TestBuffer[2] = 'p'))
         AND
            ((TestBuffer[3] = 'F')
            OR (TestBuffer[3] = 'M')
            OR (TestBuffer[3] = 'P')
            OR (TestBuffer[3] = 'f')
            OR (TestBuffer[3] = 'm')
            OR (TestBuffer[3] = 'p'))
         THEN
         {If last two figures translated into uppercase by morse, do it
lower case}
         BEGIN
            IF (TestBuffer[2] = 'F')
            OR (TestBuffer[2] = 'M')
            OR (TestBuffer[2] = 'P') THEN
               TestBuffer[2] := Chr(Byte(Ord(TestBuffer[2])+32));
            IF (TestBuffer[3] = 'F')
            OR (TestBuffer[3] = 'M')
            OR (TestBuffer[3] = 'P') THEN
               TestBuffer[3] := Chr(Byte(Ord(TestBuffer[3])+32));
            TestBuffer := KennyToNormal(TestBuffer);
            Delete(Selbuffer, Index, 3);
            Insert(TestBuffer, Selbuffer, Index);
            Index := Index-3;
         END
         ELSE
            Index := index-1
      END;
      CoderMemo.Seltext := SelBuffer;
      CoderMemo.SetFocus;      
   END;


   FUNCTION To_Kennyspeak (source : string) : string;

   VAR
      Index :  integer;

   BEGIN
       Result :='';
       Index := 1;
       WHILE Index <= Length(Source) DO
       BEGIN
          IF (Source[Index] < 'A')
          OR ((Source[Index] >'Z') AND (Source[Index]<'a'))
          OR (Source[Index] >'z') THEN
             Result := Result+Source[Index]
          else
             CASE Source[Index] OF
             'a': result := result+'mmm';
             'b': result := result+'mmp';
             'c': result := result+'mmf';
             'd': result := result+'mpm';
             'e': result := result+'mpp';
             'f': result := result+'mpf';
             'g': result := result+'mfm';
             'h': result := result+'mfp';
             'i': result := result+'mff';
             'j': result := result+'pmm';
             'k': result := result+'pmp';
             'l': result := result+'pmf';
             'm': result := result+'ppm';
             'n': result := result+'ppp';
             'o': result := result+'ppf';
             'p': result := result+'pfm';
             'q': result := result+'pfp';
             'r': result := result+'pff';
             's': result := result+'fmm';
             't': result := result+'fmp';
             'u': result := result+'fmf';
             'v': result := result+'fpm';
             'w': result := result+'fpp';
             'x': result := result+'fpf';
             'y': result := result+'ffm';
             'z': result := result+'ffp';
             'A': result := result+'Mmm';
             'B': result := result+'Mmp';
             'C': result := result+'Mmf';
             'D': result := result+'Mpm';
             'E': result := result+'Mpp';
             'F': result := result+'Mpf';
             'G': result := result+'Mfm';
             'H': result := result+'Mfp';
             'I': result := result+'Mff';
             'J': result := result+'Pmm';
             'K': result := result+'Pmp';
             'L': result := result+'Pmf';
             'M': result := result+'Ppm';
             'N': result := result+'Ppp';
             'O': result := result+'Ppf';
             'P': result := result+'Pfm';
             'Q': result := result+'Pfp';
             'R': result := result+'Pff';
             'S': result := result+'Fmm';
             'T': result := result+'Fmp';
             'U': result := result+'Fmf';
             'V': result := result+'Fpm';
             'W': result := result+'Fpp';
             'X': result := result+'Fpf';
             'Y': result := result+'Ffm';
             'Z': result := result+'Ffp';
          END;
          Index := Index+1;
       END;
   END;

   PROCEDURE BitBtTextToKennyClick(Sender: TObject);

   VAR
      CodeBuffer : String;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      CodeBuffer := CoderMemo.SelText;
      CoderMemo.Seltext := To_Kennyspeak(CodeBuffer);
      CoderMemo.SetFocus;      
   END;

   PROCEDURE BtMirrorClick(Sender: TObject);

   VAR
      Buffer : String;
      MirrorBuffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      FOR Letter := Length(Buffer) DOWNTO 1 DO
      BEGIN
       IF (copy(Buffer, Letter, 1) = #10) AND (copy(Buffer, Letter + 1, 1)
<> #13) THEN
        BEGIN
         WHILE copy(Buffer, Letter, 1) = #10 DO
          BEGIN
           MirrorBuffer := MirrorBuffer + #13#10;
           Letter := Letter - 2;
          END;
           Letter := Letter + 1;
        END
       ELSE 
         MirrorBuffer := MirrorBuffer + COPY(Buffer, Letter, 1);
      END;
      CoderMemo.SelText := MirrorBuffer;
      CoderMemo.SetFocus;      
   END;

   PROCEDURE BtRorrimClick(Sender: TObject);

   VAR
      Buffer : String;
      MirrorBuffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      FOR Letter := Length(Buffer) DOWNTO 1 DO
      BEGIN
       IF (copy(Buffer, Letter, 1) = #10) AND (copy(Buffer, Letter + 1, 1)
<> #13) THEN
        BEGIN
         WHILE copy(Buffer, Letter, 1) = #10 DO
          BEGIN
           MirrorBuffer := MirrorBuffer + #13#10;
           Letter := Letter - 2;
          END;
           Letter := Letter + 1;
        END
       ELSE
         BEGIN
          IF (Letter mod 2) = 0 THEN
            MirrorBuffer := MirrorBuffer + UpperCase(COPY(Buffer, Letter,
1))
           ELSE
            MirrorBuffer := MirrorBuffer + LowerCase(COPY(Buffer, Letter,
1)); 
         END;    
      END;
      CoderMemo.SelText := MirrorBuffer;
      CoderMemo.SetFocus;      
   END;

   PROCEDURE BtToHexClick(Sender: TObject);

   VAR
      Buffer : String;
      HexBuffer : String;
      Letter : INTEGER;
      
   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      FOR Letter := 1 TO Length(Buffer) DO
       BEGIN 
         IF (((Letter / 16) - Int(Letter / 16)) <> 0) AND (Letter <
Length(Buffer)) THEN
          HexBuffer := HexBuffer + IntToHex(ord(Buffer[Letter]),2) + ' '
         ELSE
          HexBuffer := HexBuffer + IntToHex(ord(Buffer[Letter]),2) +
#13#10; 
       END;
      CoderMemo.SelText := HexBuffer;
      CoderMemo.SetFocus;      
   END;

   PROCEDURE BtFromHexClick(Sender: TObject);

   VAR
      Buffer : String;
      HexBuffer : String;
      Letter : INTEGER;
      Temp : String;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      HexBuffer := CoderMemo.SelText;
      FOR Letter := 1 TO Length(HexBuffer) DO
       BEGIN 
        TRY 
         Temp := '$' + HexBuffer[Letter] + HexBuffer[Letter + 1]; 
         Buffer := Buffer + chr(StrToInt(Temp));
         Letter := Letter + 2;
         IF HexBuffer[Letter] = chr($0D) THEN
          Letter := Letter + 1;
        EXCEPT
        END;         
       END;
      CoderMemo.SelText := Buffer;
      CoderMemo.SetFocus;      
   END;

   PROCEDURE BtRot13Click(Sender: TObject);

   VAR
      Buffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      FOR Letter := 1 TO Length(Buffer) DO
      BEGIN
         IF ((Buffer[letter] >= 'A' )AND (Buffer[letter]<='M'))
         OR ((Buffer[letter]>= 'a')  AND( Buffer[letter]<= 'm')) THEN
            Buffer[letter] := chr(ord(Buffer[letter])+13)
         ELSE IF ((Buffer[letter] >='N') AND (Buffer[letter] <='Z'))
         OR (( Buffer[letter]>='n')  AND (Buffer[letter] <='z')) THEN
            Buffer[letter] := chr(ord(Buffer[letter])-13);
      END;
      CoderMemo.SelText := Buffer;
      CoderMemo.SetFocus;      
   END;

   FUNCTION Power(Base, Exponent: Integer): Extended;
    
   VAR
    Temp_Result : Integer;
    i : Integer;
    
    BEGIN
     IF Exponent = 0 THEN
      Temp_Result := 1
     ELSE IF (Base = 0) AND (Exponent > 0) THEN
      Temp_Result := 0
     ELSE IF Exponent = 1 THEN
      Temp_Result := Base
     ELSE IF Exponent = 2 THEN
      Temp_Result := Base * Base
     ELSE
      BEGIN
       Temp_Result := Base;
       FOR i := 2 TO Exponent DO
         Temp_Result := Temp_Result * Base; 
      END;
     Result := Temp_Result;
   END;

   PROCEDURE Str (X : Extended; VAR S : String);
 
   VAR DotPos : Integer;
 
   BEGIN
    S := FloatToStr (X);
    DotPos := Pos ('.',S);
    IF DotPos > 0 THEN
     S := copy (S,1,DotPos - 1);
   END;

   FUNCTION CharToBin(InChar : Char; ByteGroup : Byte) : String;

   VAR
    IntValue : Byte;
    DecChar : Extended;
    TempStr : String;
    Temp : String;
    i : Integer;

   BEGIN
    TempStr := '';
    IntValue := ord(InChar);
    DecChar := IntValue;
    FOR i := (ByteGroup - 1) DOWNTO 0 DO
     BEGIN
      Str(Int(DecChar / Power(2,i)),Temp);
      TempStr := TempStr + Temp;
      DecChar := DecChar - (Int(DecChar / Power(2,i)) * Power(2,i));
     END;
    Result := TempStr;
   END;

   FUNCTION BinToBase (BinString : String) : String;

   VAR
    i : Integer;
    j : Integer;
    BinValue : String;
    TempStr : String;
    BinResult : Extended;
    IntResult : Integer;
 
   BEGIN
    i := 1;
    WHILE i < Length (BinString) DO
     BEGIN
      BinResult := 0;
      BinValue := copy(BinString, i, 6);
      FOR j := 0 TO 5 DO
       BEGIN
        BinResult := BinResult + StrToInt(BinValue[6-j]) * Power(2,j);
       END;
      i := i + 6;
      Str(Int(BinResult),TempStr);
      IntResult := StrToInt(TempStr);
       IF (IntResult >= 0) AND (IntResult <= 25) THEN
        BEGIN
         IntResult := IntResult + 65;
         Result := Result + chr(IntResult);
        END
       ELSE IF (IntResult >= 26) AND (IntResult <= 51) THEN
        BEGIN
         IntResult := IntResult + 71;
         Result := Result + chr(IntResult);
        END
       ELSE If (IntResult >= 52) AND (IntResult <= 61) THEN
        BEGIN
         IntResult := IntResult - 4;
         Result := Result + chr(IntResult);
        END
       ELSE If (IntResult = 62) THEN
        BEGIN
         IntResult := IntResult - 19;
         Result := Result + chr(IntResult);
        END
       ELSE If (IntResult = 63) THEN
        BEGIN
         IntResult := IntResult + 16;
         Result := Result + chr(IntResult);
        END;
     END;   {of while}
   END;

   FUNCTION DecToBin(Digit : Byte; ByteGroup : Byte) : String;

   VAR
    DecDigit : Extended;
    TempStr : String;
    Temp : String;
    i : Integer; 

   BEGIN
    TempStr := '';
    DecDigit := Digit;
    FOR i := (ByteGroup - 1) DOWNTO 0 DO
     BEGIN
      Str(Int(DecDigit / Power(2,i)),Temp);
      TempStr := TempStr + Temp;
      DecDigit := Int(DecDigit - (Int(DecDigit / Power(2,i)) *
Power(2,i)));
     END;
    Result := TempStr;
   END;

   FUNCTION BinToAsc (BinString : String; ByteGroup : Byte) : String;

   VAR i : Integer;
       j : Integer;
       TempStr : String;
       Temp : String;
       BinResult : Extended;

   BEGIN
     i := 1;
     WHILE i < Length(BinString) DO
      BEGIN
       BinResult := 0;
       TempStr := copy (Binstring,i,ByteGroup);
        FOR j := ByteGroup DOWNTO 1 DO
         BEGIN 
          TRY
           BinResult := BinResult + StrToInt(TempStr[j]) *
Power(2,(ByteGroup - j));
          EXCEPT                                       
          END; 
         END;
       i := i + ByteGroup;
       Str(Int(BinResult),Temp);
       Result := Result + chr(StrToInt(Temp));
      END;
   END;

   FUNCTION BaseToBin (BaseString : String) : String;
   
   VAR
    i : Integer;
    BaseResult : Integer;

   BEGIN
    i := 1;
    WHILE i <= Length (BaseString) DO
     Begin
       IF (BaseString[i] >= 'A') AND  (BaseString[i] <= 'Z') THEN
        BEGIN
         BaseResult := ord(BaseString[i]) - 65;
         Result := Result + DecToBin(BaseResult, 6);
        END
       ELSE IF (BaseString[i] >= 'a') AND  (BaseString[i] <= 'z') THEN
        BEGIN
         BaseResult := ord(BaseString[i]) - 71;
         Result := Result + DecToBin(BaseResult, 6);
        END
       ELSE IF (BaseString[i] >= '0') AND  (BaseString[i] <= '9') THEN
        BEGIN
         BaseResult := ord(BaseString[i]) + 4;
         Result := Result + DecToBin(BaseResult, 6);
        END
       ELSE IF BaseString[i] = '+' THEN
        BEGIN
         BaseResult := ord(BaseString[i]) + 19;
         Result := Result + DecToBin(BaseResult, 6);
        END
       ELSE IF BaseString[i] = '/' THEN
        BEGIN
         BaseResult := ord(BaseString[i]) - 16;
         Result := Result + DecToBin(BaseResult, 6);
        END
       ELSE IF BaseString[i] = '=' THEN
        BEGIN
         BaseResult := 0;
         Result := Result + DecToBin(BaseResult, 6);
        END;
       i := i + 1;
     END;   {of while}
   END;

   PROCEDURE IntoBaseBtClick(Sender: TObject);
   VAR
      Buffer : String;
      Letter : INTEGER;
      BinBuffer : String;
      LenBuffer : Integer;
      BaseBuffer : String;
      FillValue : Byte;
      i : Byte;
      Seperator : Integer;
      TempString : String;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      LenBuffer := Length(Buffer);
      BinBuffer := '';
      TempString := '';
      Seperator := 1;
      FillValue := 0;
      Letter := 1;
     WHILE Letter <= LenBuffer DO
       BEGIN
        BinBuffer := BinBuffer + CharToBin(Buffer[Letter],8);
        Letter := Letter + 1;
       END;
      WHILE ((LenBuffer / 3) - Int(LenBuffer / 3)) <> 0 DO
       BEGIN
        LenBuffer := LenBuffer + 1;
        FillValue := FillValue + 1;
        BinBuffer := BinBuffer + '00000000';
       END;
     BaseBuffer := BinToBase(BinBuffer);
     IF FillValue > 0 THEN
      BEGIN
       FOR i := 1 TO FillValue DO
        BEGIN
         BaseBuffer[Length(BaseBuffer) + (1 - i)] := '=';
        END;
      END;
     WHILE Seperator < Length(BaseBuffer) DO
      BEGIN
       TempString := TempString + copy (BaseBuffer,Seperator,64) + #13#10;
       Seperator := Seperator + 64;
      END;
     CoderMemo.Seltext := TempString;
     CoderMemo.SetFocus;
   END;

   PROCEDURE FromBaseBtClick(Sender: TObject);

   VAR
      BinBuffer : String;
      BaseBuffer : String;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      BaseBuffer := CoderMemo.SelText;
      BinBuffer := BaseToBin(BaseBuffer);
      CoderMemo.Seltext := BinToAsc(BinBuffer, 8);
      CoderMemo.SetFocus;      
   END;
   
   PROCEDURE ClearBtClick(Sender: TObject);
   
   BEGIN
     CoderMemo.Clear;
     CoderMemo.SetFocus;     
   END;  
   
   PROCEDURE CoderMemoKeyDown(Sender: TObject; var Key: Word; Shift:
TShiftState);

   BEGIN
    IF (Key=65) AND (Shift=[ssCtrl]) THEN
     BEGIN
     // MessageDlg('Es funktioniert!', mtInformation, [mbOK],0);
     CoderMemo.SelectAll;
     END;
   END;
   
   PROCEDURE ChangeFKBtClick(Sender: TObject);
   VAR
      Buffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      FOR Letter := 1 TO Length(Buffer) DO
      BEGIN
       CASE Buffer[Letter] OF
        'c' : BEGIN
               IF Buffer[Letter + 1] = 'k' THEN
               Buffer[Letter] := 'f';
              END; 
        'C' : BEGIN
               IF Buffer[Letter + 1] = 'K' THEN
               Buffer[Letter] := 'F';
              END; 
        'F' : BEGIN
               Buffer[Letter] := 'K';
              END;
        'f' : BEGIN
               Buffer[Letter] := 'k';
              END;
        'K' : BEGIN
               Buffer[Letter] := 'F';
              END;
        'k' : BEGIN
               Buffer[Letter] := 'f';
              END;
       END; {of Case}
      END; {FOR}
   CoderMemo.SelText := Buffer;
   CoderMemo.SetFocus;
   END;
   
   PROCEDURE InToLFBtClick(Sender: TObject);
   VAR
      Buffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText + ' ';
      Letter := 1;
      WHILE Letter <= Length(Buffer) DO
      BEGIN
       Case (Buffer[Letter]) of
    'a','A' : BEGIN
               IF Buffer[Letter + 1] = 'i' THEN
                BEGIN
                 insert ('laifai',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE IF Buffer[Letter + 1] = 'u' THEN
                BEGIN
                 insert ('laufau',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE
                BEGIN
                 insert ('lafa',Buffer,Letter + 1);
                 Letter := Letter + 4;
                END;
              END;
    'e','E' : BEGIN
               IF Buffer[Letter + 1] = 'i' THEN
                BEGIN
                 insert ('leifei',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE IF Buffer[Letter + 1] = 'u' THEN
                BEGIN
                 insert ('leufeu',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE IF Buffer[Letter + 1] = 'y' THEN
                BEGIN
                 insert ('leyfey',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE
                BEGIN
                 insert ('lefe',Buffer,Letter + 1);
                 Letter := Letter + 4;
                END;
              END;
    'i','I' : BEGIN
               IF Buffer[Letter + 1] = 'e' THEN
                BEGIN
                 insert ('liefie',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE
                BEGIN
                 insert ('lifi',Buffer,Letter + 1);
                 Letter := Letter + 4;
                END;
              END;
    'o','O' : BEGIN
               insert ('lofo',Buffer,Letter + 1);
               Letter := Letter + 4;
              END;
    'u','U' : BEGIN
               insert ('lufu',Buffer,Letter + 1);
               Letter := Letter + 4;
              END;
    'y','Y' : BEGIN
               insert ('lyfy',Buffer,Letter + 1);
               Letter := Letter + 4;
              END;
    'ä','Ä' : BEGIN
               IF Buffer[Letter + 1] = 'u' THEN
                BEGIN
                 insert ('läufäu',Buffer,Letter + 2);
                 Letter := Letter + 7;
                END
               ELSE
                BEGIN
                 insert ('läfä',Buffer,Letter + 1);
                 Letter := Letter + 4;
                END;
              END;
    'ö','Ö' : BEGIN
               insert ('löfö',Buffer,Letter + 1);
               Letter := Letter + 4;
              END;
    'ĂĽ','Ăś' : BEGIN
               insert ('lĂĽfĂĽ',Buffer,Letter + 1);
               Letter := Letter + 4;
              END;
       END; {of Case}
       Letter := Letter + 1;
      END; {of while}
   CoderMemo.SelText := TrimRight(Buffer);
   CoderMemo.SetFocus;
   END;


   PROCEDURE FromLFBtClick(Sender: TObject);
   VAR
      Buffer : String;
      Letter : INTEGER;

   BEGIN
      IF CoderMemo.SelLength = 0 THEN
         CoderMemo.SelectAll;
      Buffer := CoderMemo.SelText;
      Letter := 1;
      WHILE Letter <= Length(Buffer) DO
      BEGIN 
       IF  (uppercase(copy (Buffer, Letter, 8)) = 'AULAUFAU')
        or (uppercase(copy (Buffer, Letter, 8)) = 'AILAIFAI')
        or (uppercase(copy (Buffer, Letter, 8)) = 'EILEIFEI')
        or (uppercase(copy (Buffer, Letter, 8)) = 'EULEUFEU')
        or (uppercase(copy (Buffer, Letter, 8)) = 'EYLEYFEY')
        or (uppercase(copy (Buffer, Letter, 8)) = 'IELIEFIE')
        or (copy (Buffer, Letter, 8) = 'Äuläufäu')
        or (copy (Buffer, Letter, 8) = 'äuläufäu') THEN
        BEGIN
         delete (Buffer, Letter + 2, 6);
        END 
       ELSE IF (uppercase(copy (Buffer, Letter, 5)) = 'ALAFA')
        or (uppercase(copy (Buffer, Letter, 5)) = 'ELEFE')
        or (uppercase(copy (Buffer, Letter, 5)) = 'ILIFI')
        or (uppercase(copy (Buffer, Letter, 5)) = 'OLOFO')
        or (uppercase(copy (Buffer, Letter, 5)) = 'ULUFU')
        or (uppercase(copy (Buffer, Letter, 5)) = 'YLYFY')
        or (copy (Buffer, Letter, 5) = 'Äläfä')
        or (copy (Buffer, Letter, 5) = 'äläfä')
        or (copy (Buffer, Letter, 5) = 'Ölöfö')
        or (copy (Buffer, Letter, 5) = 'ölöfö')
        or (copy (Buffer, Letter, 5) = 'ĂślĂĽfĂĽ')
        or (copy (Buffer, Letter, 5) = 'ĂĽlĂĽfĂĽ') THEN
        BEGIN
         delete (Buffer, Letter + 1, 4);
        END
        ELSE
        Letter := Letter + 1;
      END; {of while}
   CoderMemo.SelText := Buffer;
   CoderMemo.SetFocus;
   END;
   
   
   PROCEDURE BuildCoderContainers;

   BEGIN
      CoderForm.Width := 800;
      CoderForm.Height:= 380;
      CoderForm.position := poScreenCenter;
      CoderForm.Caption :=
'Kenny-Mirror-Hex-Rot13-Morse-Base64-Fönigen-*L*F* Translator :-)';
      CoderMemo := tmemo.Create(CoderForm);
      CoderMemo.Parent := CoderForm;
      // have a large enought width to avoid wrap around lines
      // CoderMemo.Width := Application.Mainform.width;
      // {freeze if Application not called from the script window : waiting
for next version}
      CoderMemo.Top := 10;
      CoderMemo.Left := 10;
      CoderMemo.Height := CoderForm.ClientHeight - 70;
      CoderMemo.Width := CoderForm.ClientWidth - 20;
      CoderMemo.ScrollBars := ssVertical;
      CoderMemo.Font.Name := 'Courier New';
      CoderMemo.OnKeyDown := @CoderMemoKeyDown;
      CoderBtQuit := TButton.Create(CoderForm);
      CoderBtQuit.Parent := CoderForm;
      CoderBtQuit.Top := CoderMemo.Top + CoderMemo.Height +
CoderBtQuit.height + 6;
      CoderBtQuit.Left := (CoderForm.Width - CoderBtQuit.Width ) DIV 2;
      CoderBtQuit.Caption := '&Quit';
      CoderBtQuit.modalresult := mrOK;
      Rot13Bt := TButton.Create(CoderForm);
      Rot13Bt.Parent := CoderForm;
      Rot13Bt.Top := CoderMemo.Top + CoderMemo.Height + 3;
      Rot13Bt.Left := CoderBtQuit.Left;
      Rot13Bt.Caption := 'R&ot 13';
      Rot13Bt.OnClick := @BtRot13Click;
      ClearMemoBt := TButton.Create(CoderForm);
      ClearMemoBt.Parent := CoderForm;
      ClearMemoBt.Top := CoderBtQuit.Top;
      ClearMemoBt.Left := Rot13Bt.Left + 81;
      ClearMemoBt.Caption := '&Clear';
      ClearMemoBt.OnClick := @ClearBtClick;
      ChangeFKBt := TButton.Create(CoderForm);
      ChangeFKBt.Parent := CoderForm;
      ChangeFKBt.Top := Rot13Bt.Top;
      ChangeFKBt.Left := ClearMemoBt.Left;
      ChangeFKBt.Caption := 'Fönigen';
      ChangeFKBt.OnClick := @ChangeFKBtClick;
      MirrorBt := TButton.Create(CoderForm);
      MirrorBt.Parent := CoderForm;
      MirrorBt.Top := CoderMemo.Top + CoderMemo.Height + 3;
      MirrorBt.Left := CoderBtQuit.Left - 81;
      MirrorBt.Caption := 'Mi&rror';
      MirrorBt.OnClick := @BtMirrorClick;
      RoRrImBt := TButton.Create(CoderForm);
      RoRrImBt.Parent := CoderForm;
      RoRrImBt.Top := CoderBtQuit.Top;
      RoRrImBt.Left := CoderBtQuit.Left - 81;
      RoRrImBt.Caption := 'RoRr&Im';
      RoRrImBt.OnClick := @BtRorrimClick;
      IntoMorse := TButton.Create(CoderForm);
      IntoMorse.Parent := CoderForm;
      IntoMorse.Top := Rot13Bt.Top;
      IntoMorse.Left := CoderForm.ClientWidth * 3 DIV 4 - IntoMorse.Width +
4;
      IntoMorse.Caption := '&To Morse';
      IntoMorse.OnClick := @BitBtTextToMorseClick;
      FromMorseBt := TButton.Create(CoderForm);
      FromMorseBt.Parent := CoderForm;
      FromMorseBt.Top := CoderBtQuit.Top;
      FromMorseBt.Left := IntoMorse.Left;
      FromMorseBt.Caption := 'From &Morse';
      FromMorseBt.OnClick := @BitBtMorseToTextClick;
      IntoKenny := TButton.Create(CoderForm);
      IntoKenny.Parent := CoderForm;
      IntoKenny.Top := Rot13Bt.Top;
      IntoKenny.Left := CoderForm.ClientWidth DIV 4 - IntoKenny.Width - 2;
      IntoKenny.Caption := 'To &Kenny';
      IntoKenny.OnClick := @BitBtTextToKennyClick;
      FromKennyBt := TButton.Create(CoderForm);
      FromKennyBt.Parent := CoderForm;
      FromKennyBt.Top := CoderBtQuit.Top;
      FromKennyBt.Left := IntoKenny.Left;
      FromKennyBt.Caption := '&From Kenny';
      FromKennyBt.OnClick := @BitBtKennyToNormalClick;
      IntoHexBt := TButton.Create(CoderForm);
      IntoHexBt.Parent := CoderForm;
      IntoHexBt.Top := Rot13Bt.Top;
      IntoHexBt.Left := CoderForm.ClientWidth DIV 4 + 2;
      IntoHexBt.Caption := 'To &Hex';
      IntoHexBt.OnClick := @BtToHexClick;
      FromHexBt := TButton.Create(CoderForm);
      FromHexBt.Parent := CoderForm;
      FromHexBt.Top := CoderBtQuit.Top;
      FromHexBt.Left := IntoHexBt.Left;
      FromHexBt.Caption := 'From He&x';
      FromHexBt.OnClick := @BtFromHexClick;
      IntoBase64Bt := TButton.Create(CoderForm);
      IntoBase64Bt.Parent := CoderForm;
      IntoBase64Bt.Top := Rot13Bt.Top;
      IntoBase64Bt.Left := CoderForm.ClientWidth * 3 DIV 4 + 8;
      IntoBase64Bt.Caption := 'To &Base-64';
      IntoBase64Bt.OnClick := @IntoBaseBtClick;
      FromBase64Bt := TButton.Create(CoderForm);
      FromBase64Bt.Parent := CoderForm;
      FromBase64Bt.Top := CoderBtQuit.Top;
      FromBase64Bt.Left := IntoBase64Bt.Left;
      FromBase64Bt.Caption := 'Fr. B&ase-64';
      FromBase64Bt.OnClick := @FromBaseBtClick;
      Free1Bt := TButton.Create(CoderForm);
      Free1Bt.Parent := CoderForm;
      Free1Bt.Top := Rot13Bt.Top;
      Free1Bt.Left := CoderForm.ClientWidth * 3 DIV 4 + Free1Bt.Width + 12;
      Free1Bt.Caption := 'FREE';
   //   Free1Bt.OnClick := @??;
      Free1Bt.Enabled := False;
      Free2Bt := TButton.Create(CoderForm);
      Free2Bt.Parent := CoderForm;
      Free2Bt.Top := CoderBtQuit.Top;
      Free2Bt.Left := Free1Bt.Left;
      Free2Bt.Caption := 'FREE';
   //   Free2Bt.OnClick := @??;
      Free2Bt.Enabled := False;
      InToLFBt := TButton.Create(CoderForm);
      IntoLFBt.Parent := CoderForm;
      IntoLFBt.Top := Rot13Bt.Top;
      IntoLFBt.Left := CoderForm.ClientWidth DIV 6 - IntoLFBt.Width - 16;
      IntoLFBt.Caption := 'To *L*F*';
      IntoLFBt.OnClick := @InToLFBtClick;
      FromLFBt := TButton.Create(CoderForm);
      FromLFBt.Parent := CoderForm;
      FromLFBt.Top := CoderBtQuit.Top;
      FromLFBt.Left := IntoLFBt.Left;
      FromLFBt.Caption := 'From *L*F*';
      FromLFBt.OnClick := @FromLFBtClick;
   END;

BEGIN
   CodeMorse := TstringList.Create;
   CodeLetter := TstringList.Create;
   try
   CodeMorse := TstringList.Create;
   CodeLetter := TstringList.Create;
   CodeMorse.Add('A=.-');   CodeMorse.Add('B=-...');
CodeMorse.Add('C=-.-.');
   CodeMorse.Add('D=-..');   CodeMorse.Add('E=.');
CodeMorse.Add('F=..-.');
   CodeMorse.Add('G=--.');   CodeMorse.Add('H=....');
CodeMorse.Add('I=..');
   CodeMorse.Add('J=.---');   CodeMorse.Add('K=-.-');
CodeMorse.Add('L=.-..');
   CodeMorse.Add('M=--');   CodeMorse.Add('N=-.');
CodeMorse.Add('O=---');
   CodeMorse.Add('P=.--.');   CodeMorse.Add('Q=--.-');
CodeMorse.Add('R=.-.');
   CodeMorse.Add('S=...');   CodeMorse.Add('T=-');
CodeMorse.Add('U=..-');
   CodeMorse.Add('V=...-');   CodeMorse.Add('W=.--');
CodeMorse.Add('X=-..-');
   CodeMorse.Add('Y=-.--');   CodeMorse.Add('Z=--..');
CodeMorse.Add('0=-----');
(*
   CodeMorse.add('a=.-');   CodeMorse.add('b=-...');
CodeMorse.add('c=-.-.');
   CodeMorse.add('d=-..');   CodeMorse.add('e=.');
CodeMorse.add('f=..-.');
   CodeMorse.add('g=--.');   CodeMorse.add('h=....');
CodeMorse.add('i=..');
   CodeMorse.add('j=.---');   CodeMorse.add('k=-.-');
CodeMorse.add('l=-.-..');
   CodeMorse.add('m=--');   CodeMorse.add('n=-.');
CodeMorse.add('o=---');
   CodeMorse.add('p=.--.');   CodeMorse.add('q=--.-');
CodeMorse.add('r=.-.');
   CodeMorse.add('s=...');   CodeMorse.add('t=-');
CodeMorse.add('u=..-');
   CodeMorse.add('v=...-');   CodeMorse.add('w=.--');
CodeMorse.add('x=-..-');
   CodeMorse.add('y=-.--');   CodeMorse.add('z=--..');
CodeMorse.add('0=-----');
*)
   CodeMorse.Add('1=.----');   CodeMorse.Add('2=..---');
CodeMorse.Add('3=...--');
   CodeMorse.Add('4=....-');   CodeMorse.Add('5=.....');
CodeMorse.Add('6=-....');
   CodeMorse.Add('7=--...');   CodeMorse.Add('8=---..');
CodeMorse.Add('9=----.');
   CodeMorse.Add('.=.-.-.-');   CodeMorse.Add(',=--..--');
CodeMorse.Add('?=..--..');
   CodeMorse.Add('-=-....-');   CodeMorse.Add('/=-..-.');   CodeMorse.Add('
= / ');
   CodeMorse.Add('ERROR=........'); CodeMorse.Add('+=.-.-.');
CodeMorse.Add('@=...-.-');
   CodeMorse.Add('SOS=...---...');

{international morse set}
   {å ä à é ö ü " ! ß (S-zet) }
{$IFDEF Nordik}
   CodeMorse.Add('Ă…=.--.-');
{$ELSE}
   CodeMorse.Add('Ă€=.--.-');
{$ENDIF}
   CodeMorse.Add('Ă„=.-.-');
   CodeMorse.Add('É=..-..');   CodeMorse.Add('Ö=---.');
CodeMorse.Add('Ăś=..--');
   CodeMorse.Add('"=.-..-.');   CodeMorse.Add('!=..--.');
CodeMorse.Add('Ăź=----');


   FOR Index := 0 TO CodeMorse.Count-1 DO
   BEGIN
      CodeLine := CodeMorse.Strings[Index];
      EqualPos := Pos('=', CodeLine);
      CodeLine := Copy(CodeLine, EqualPos+1,
Length(CodeLine)-EqualPos)+'='+Copy(CodeLine,1,EqualPos-1);
      CodeLetter.Add(CodeLine);
   END;
   CodeLetter.Add('/= ');
   Ado('Copy');
   CoderForm := tform.Create(nil);
   try
   BuildCoderContainers;
   Codermemo.PasteFromCLipboard;
   CoderForm.ShowModal;
   finally
   CoderForm.Free;
   end;
   finally
   CodeMorse.Free;
   CodeLetter.Free;
   end;
END.



This script is big enough and wide enough that it needs continuation
characters.  Does anyone have a reference for the syntax of whatever
scripting language this is?

With the sig set for %randomsig:F:\data\sigs2.txt%, I'm able to read and
write to newsgroups with dialog coming off a memory stick off someone
else's laptop.
-- 
There is a saying in Baltimore that crabs may be prepared in fifty ways and
that all of them are good.
H. L. Mencken
Re: [dialog] re-installation
#222927
Author: John Hosking
Date: Sun, 06 Jul 2008 15:16
39 lines
2683 bytes
On Sat, 5 Jul 2008 18:19:33 -0600, Ron Ford wrote:

> 
> This is huge:

We believe you; you don't have to post it here. Or did you mean "huge" as
in "great," "wonderful," "extremely useful?"

> 
> Program Kenny_Mirror_Hex_Rot13_Morse_Base64_Translater;
> 

[about 1400 lines of pointlessly pasted script snipped]

> END.
> 
> 
> This script is big enough and wide enough that it needs continuation
> characters.  Does anyone have a reference for the syntax of whatever
> scripting language this is?

Well, since we're all talking about Dialog, it must be Turbo Pascal. From
the Dialog Help, first result when one searches for "script":

"Scripts in Dialog are written in the Object Pascal language, as known from
Borland's Delphi."

Possibly you will be able to use a search engine (e.g.
http://www.google.com/) or look in Wikipedia (http://en.wikipedia.org/) to
find something on Object Pascal syntax. I used to program in Pascal, but I
don't remember even using continuation characters. It was several ages ago,
but I think we just went to the next line, without a semi-colon terminating
the previous one. Does Pascal even have continuation characters?

So having said all that, I have to ask: where do you see continuation
characters? Or why do you think you need to add them?

-- 
John
Re: [dialog] re-installation
#222952
Author: Ron Ford
Date: Sun, 06 Jul 2008 23:35
58 lines
3491 bytes
On Sun, 6 Jul 2008 17:16:30 +0200, John Hosking posted:

> On Sat, 5 Jul 2008 18:19:33 -0600, Ron Ford wrote:
> 
>> 
>> This is huge:
> 
> We believe you; you don't have to post it here. Or did you mean "huge" as
> in "great," "wonderful," "extremely useful?"

Most of the scripts for dialog are short and fire events.  I thought that
getting this one to work might go a long way to getting used to this
syntax.


>> This script is big enough and wide enough that it needs continuation
>> characters.  Does anyone have a reference for the syntax of whatever
>> scripting language this is?
> 
> Well, since we're all talking about Dialog, it must be Turbo Pascal. From
> the Dialog Help, first result when one searches for "script":
> 
> "Scripts in Dialog are written in the Object Pascal language, as known from
> Borland's Delphi."
> 
> Possibly you will be able to use a search engine (e.g.
> http://www.google.com/) or look in Wikipedia (http://en.wikipedia.org/) to
> find something on Object Pascal syntax. I used to program in Pascal, but I
> don't remember even using continuation characters. It was several ages ago,
> but I think we just went to the next line, without a semi-colon terminating
> the previous one. Does Pascal even have continuation characters?
> 
> So having said all that, I have to ask: where do you see continuation
> characters? Or why do you think you need to add them?

Whenever I see source that is sufficiently wide for usenet to fold over, I
think to need a continuation character.  I looked around, and I don't think
I need one with Delphi, like one doesn't need with perl.  

Some useful links:

http://www.daniweb.com/code/delphi.html

http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)

http://en.wikipedia.org/wiki/Object_Pascal

http://delphi.about.com/

Comments are like this:
Object Pascal (Delphi): 
(* BlockComment *)
{ BlockComment }
// InlineComment
-- 
The older I grow the more I distrust the familiar doctrine that age brings
wisdom.
H. L. Mencken
Re: [dialog] re-installation
#223224
Author: Bernd Rose
Date: Sat, 12 Jul 2008 18:59
32 lines
2541 bytes
On Wed, 2 Jul 2008 19:44:28 -0700, Ron Ford wrote:

> 4)  (Especially for Bernd bzw. Oliver)  Can I use mtr.exe to count the the
> number of files that I have currently in 40tude's root install?

Minitrue is a string handling tool. Although it might possibly be 
(mis-)used to count files, I wouldn't recommend this. You may just
select all files (Ctrl+A selects all files and folders of the 
current directory) inside Explorer and right click on that selection.
Choose [Properties] and you get the number of files (and as a 
separate value: directories).

If you only need the count of files of a special file type, use 
the [Search] entry inside the right-click menu of the main folder.
You'll see the number of found "objects" in the status line.

If you better like a command line solution, you may try the 
following 4 lines inside a *.bat or *.cmd file:

@echo off
set /a cnt=0
for /r %%f in (*.*) do set /a cnt+=1
echo %cnt%

Remove the /r switch of the for command, if you don't need to
recurse into subdirectories. And adjust the search pattern, if
you only need a special file type.

I lost track, which of your other questions have already been
answered. So I'll leave it at this...  ;-)

Bernd
Re: [dialog] re-installation
#223259
Author: Ron Ford
Date: Mon, 14 Jul 2008 03:13
89 lines
4789 bytes
On Sat, 12 Jul 2008 20:59:39 +0200, Bernd Rose posted:

> On Wed, 2 Jul 2008 19:44:28 -0700, Ron Ford wrote:
> 
>> 4)  (Especially for Bernd bzw. Oliver)  Can I use mtr.exe to count the the
>> number of files that I have currently in 40tude's root install?
> 
> Minitrue is a string handling tool. Although it might possibly be 
> (mis-)used to count files, I wouldn't recommend this. You may just
> select all files (Ctrl+A selects all files and folders of the 
> current directory) inside Explorer and right click on that selection.
> Choose [Properties] and you get the number of files (and as a 
> separate value: directories).
> 
> If you only need the count of files of a special file type, use 
> the [Search] entry inside the right-click menu of the main folder.
> You'll see the number of found "objects" in the status line.
> 
> If you better like a command line solution, you may try the 
> following 4 lines inside a *.bat or *.cmd file:
> 
> @echo off
> set /a cnt=0
> for /r %%f in (*.*) do set /a cnt+=1
> echo %cnt%
> 
> Remove the /r switch of the for command, if you don't need to
> recurse into subdirectories. And adjust the search pattern, if
> you only need a special file type.
> 
> I lost track, which of your other questions have already been
> answered. So I'll leave it at this...  ;-)

What a dynamite little utility is that:
REM batch file from Bernd Rose to count files in directory
REM /r recurses through subdirectories

@echo off
set /a cnt=0
for /r %%f in (*.*) do set /a cnt+=1
echo %cnt%

You run it as a batch file in a dos window in the directory you want to
count.  My mtr question changed over time.  Before, we looked through
msg*.dat, pulling against Richard's sig:

%% 
%% Then minitrue can do its thing, because your separator is DEL, a.k.a.  
%% hex 7F:
%% mtr.exe  -xo^^$i:sig.txt msg*.dat > RMaine.txt
%% , where sig.txt is the familiar:
%% 
%% "[^\x7F]*\r\nRichard Maine +\| Good judgement comes from 
%% experience;\r\nemail: last name at domain . net \| experience comes from 
%% bad judgement.\r\ndomain: summertriangle +\|  -- Mark Twain[^\x7F]*\x7F"

I just downloaded 267 articles from "trudogg," who doesn't use a sig.  How
would we delimit based on other information and pluck out those articles?

Here is what one of dogg's headers looks like:

Path:
uni-berlin.de!fu-berlin.de!nlpi057.nbdc.sbc.com!prodigy.net!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 12 Jul 2008 06:35:35 -0500
From: trudogg <independent@long.last>
Newsgroups: misc.news.internet.discuss
Subject: Red Lines
Date: Sat, 12 Jul 2008 07:35:34 -0400
Message-ID: <bh5h74pdt8q87r2e0lcoiohrmqckaf3mgn@4ax.com>
X-Newsreader: Forte Agent 4.2/32.1117
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 34
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.203.71.38
X-Trace:
sv3-bq8WA+qolbZDXTBwMBOaRl2vkO1PsjIU4NtCsnnUbKT156yZQ7V6s9zPkXqfpK/xeaRekVW2TQU3Mug!Gs9yZevSs7BpzJB7+voGb2V+L0ju8JNzB6rxnzuvkr7UMuaPyLmAnPVXcx0slWJVor2vnRWB6qOI!RkEpzhcV8gmLiYLjceeblP9FFw==
X-Complaints-To: abuse@comcast.net
X-DMCA-Complaints-To: dmca@comcast.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
X-Postfilter: 1.3.39
Bytes: 2817
Xref: uni-berlin.de misc.news.internet.discuss:376397
-- 
Alimony - the ransom that the happy pay to the devil.
H. L. Mencken
Re: [dialog] re-installation
#223271
Author: Bernd Rose
Date: Mon, 14 Jul 2008 20:07
31 lines
2642 bytes
On Sun, 13 Jul 2008 21:13:09 -0600, Ron Ford wrote:

> I just downloaded 267 articles from "trudogg," who doesn't use a sig.  How
> would we delimit based on other information and pluck out those articles?
> 
> Here is what one of dogg's headers looks like:
<Snip>

Your primary request about filters on multi-line Sigs was a special
case, which is only necessary, when people change their "From:" too
often, but keep their Sig unvaried.

Usually you can filter on "From:" lines. Since the resulting search
string isn't too long, it is possible to do it as a one-liner without
an additional filter file:

mtr.exe -xo^^$ msg*.dat "[^\x00\x01\x7F]*\r\nFrom: trudogg <independent@long.last>\r\n[^\x7F]*\x7F" > Trudogg.txt

Or if he uses changing "From" addresses but keeps the "From" name 
(again all on one line):

mtr.exe -xo^^$ msg*.dat "[^\x00\x01\x7F]*\r\nFrom: trudogg <[^>\r\n]+>\r\n[^\x7F]*\x7F" > Trudogg.txt

I posted the version which also eliminates the msg*.dat header for
first-of-file postings, since I regard this the more complete 
realization. 

The next extract filters should now be easy and are therefore left 
as an exercise... ;-)

Bernd
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads