Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bitte um Hilfe: Footnote-Support (Include-File)

0 views
Skip to first unread message

Joerg Fimpel-Janning

unread,
Apr 13, 2005, 3:48:22 AM4/13/05
to
Moin zusammen,
das Script würde ich gerne mir installieren, doch leider komme ich mit dem
installieren von den sog. Include-Scripts nicht klar (liegt sicher an
meiner unenglischen Art UND an an meiner Unzulänglichkeit!

Wenn ich das richtig verstehe, dann muss ich erst ein neues Script
erstellen, in das ich das auf der Seite [1] angegebene Beispielscript
reinkopiere:
> program OnBeforeSendingMessage;
> {$I Footnote_include.ds}

> function OnBeforeSendingMessage(var Message: TStringlist; Servername: string; IsEmail: boolean):boolean;
> begin
> result:=true;

> result := doFootNoteNew ( Message );

> //possibly some other calls to scripts

> end;

> begin
> end.

Dieses Script speichere ich dann OHNE es zu kompilieren.
Dann sind da ja noch die beiden anderen Code-Kästen:

Setup in the script:
If you want to change the setup for the footnotes, you have to edit the
lines below inside the script.

> //
> // Configuration Options:
...

UND das eigentliche Script

> //
> // program Footnotes - Date: 2004/11/05
> // ...

Ich weiß (wenn ich so bedenke, wer hier schreibt - meistens vertehe ich nur
"Bagnhof"), dass das für Euch mal wieder eine Dummie-Frage ist, aber solche
wie mich gibt´s halt auch.
Danke schon mal für Eure Geduld
Gruß Jörg

[1] http://www.40tude.com/dialog/wiki/index.php/Footnotesupport_include

--
http://www.raphael-schule.de
http://www.jorgos.info

Enrico Bauer

unread,
Apr 13, 2005, 3:54:25 AM4/13/05
to
*Joerg Fimpel-Janning* 13.04.2005:

> Wenn ich das richtig verstehe, dann muss ich erst ein neues Script
> erstellen, in das ich das auf der Seite [1] angegebene Beispielscript
> reinkopiere:
>> program OnBeforeSendingMessage;
>> {$I Footnote_include.ds}
[...]

> Dieses Script speichere ich dann OHNE es zu kompilieren.

Genau falsch. :-) *Dieses* Skript speichern und kompilieren; das
Include-File, das, in dem du die Konfiguration vornimmst, *nur*
speichern, _nicht_ kompilieren.

Grüße
Enrico

--
My finger is on the button.

Alexander Sailer

unread,
Apr 13, 2005, 4:01:56 AM4/13/05
to
Servus Joerg:

> Moin zusammen,
> das Script würde ich gerne mir installieren, doch leider komme ich mit dem
> installieren von den sog. Include-Scripts nicht klar (liegt sicher an
> meiner unenglischen Art UND an an meiner Unzulänglichkeit!

Ich habe dies heute erst gemacht, also sollte es möglich sein Dein Script
zum korrekten Arbeiten zu bewegen;)

> Wenn ich das richtig verstehe, dann muss ich erst ein neues Script
> erstellen, in das ich das auf der Seite [1] angegebene Beispielscript
> reinkopiere:
>> program OnBeforeSendingMessage;

Nicht ganz. Dieser Code sollte in das Ereignisscript OnBeforeSendMessage
eingefügt werden.

> Setup in the script:
> If you want to change the setup for the footnotes, you have to edit the
> lines below inside the script.

Dies ist nur eine Erklärung der Configuration des Scripts. IMHO kannst Du
mit dieser Erklärung die Variablen/Parameter des Scripts ändern.


> UND das eigentliche Script

Dieses musst Du kopoieren und in EigeneScripte einfügen, wobei die
Kompilierung mit diesem Script keinen Sinn macht, da ein Fehler auftritt.


> Ich weiß (wenn ich so bedenke, wer hier schreibt - meistens vertehe ich nur
> "Bagnhof"), dass das für Euch mal wieder eine Dummie-Frage ist, aber solche
> wie mich gibt´s halt auch.

Antwort[1]


Footnotes:
==========
[1] Es gibt keine dummen Fragen, nur dumme Antworten
--
Gruß Alex
Und morgen gehts mit gleichem Fleiße wieder an die selbe ...
FAQ,s : http://www.mpdvc.de
Samples: http://codeguru.developer.com http://www.codeproject.com
Anstand: news:de.newusers.infos www.learn.to/quote

Maik Prinz

unread,
Apr 13, 2005, 4:09:34 AM4/13/05
to
* am Mi, 13. Apr. 2005 um 9:54 war von Enrico Bauer zu lesen...

...bitte *nicht* in dieser Reihenfolge. :-)

cu, Maik
--
3D Wallpaper: http://www.2prinz.de

Message has been deleted

Joerg Fimpel-Janning

unread,
Apr 13, 2005, 11:07:34 AM4/13/05
to
Quote [*Alexander Sailer* schrieb am 13.4.05 - 10:01h]

Hallo Alexander,

> Ich habe dies heute erst gemacht, also sollte es möglich sein Dein Script
> zum korrekten Arbeiten zu bewegen;)

ich bin nun nach Deiner "Anleitung" #fn#Danke dafür!## vorgegangen und bin
nun gespannt, ob´s was genützt hat. Deshalb klicke ich jetzt einfach mal
auf die "Send-Taste" ;-)

> ...


> [1] Es gibt keine dummen Fragen, nur dumme Antworten

Das ist so ein Spruch, der oft stimmt, trotzdem denke ich mir manchmal (in
anderen Zusammenhängen - "Maaaan, wie kann man nur so doof fragen". Deshalb
Dir und Enrico und Maik vielen Dank.
Gruß Jörg

Joerg Fimpel-Janning

unread,
Apr 13, 2005, 11:10:03 AM4/13/05
to
Quote [*Joerg Fimpel-Janning* schrieb am 13.4.05 - 17:07h]

so ein sh**, ...

> ich bin nun nach Deiner "Anleitung" #fn#Danke dafür!## ...
warum geht das nicht?

frustrierten Gruß
Jörg

P.S. Muss ich vielleicht 40tude neu starten, damit das Script schreibt?
--
s u c h e: Zuiko Digital 11-22mm (used)
http://www.raphael-schule.de
http://www.jorgos.info

Andreas Loch

unread,
Apr 13, 2005, 11:26:06 AM4/13/05
to
2005-04-13, Joerg Fimpel-Janning:

> Quote [*Joerg Fimpel-Janning* schrieb am 13.4.05 - 17:07h]

>> ich bin nun nach Deiner "Anleitung" #fn#Danke dafür!## ...
>
> warum geht das nicht?

Skript kompiliert? Skriptausführung aktiviert?

> P.S. Muss ich vielleicht 40tude neu starten, damit das Script schreibt?

Nö. Zur Not könntest Du den Menüpunkt "Skripte neu laden" probieren,
aber normalerweise ist das nicht nötig.

Andreas

--
http://gigaschatten.de/
40tude Dialog - http://www.40tude.com/dialog/
Newsoffice.de - http://newsoffice.de/

Joerg Fimpel-Janning

unread,
Apr 13, 2005, 11:27:51 AM4/13/05
to
Quote [*Joerg Fimpel-Janning* schrieb am 13.4.05 - 09:48h]

Also, das ist ja nicht so einfach mit mir :-(

Ich habe nun im "OnBeforeSending..." stehen:
program OnBeforeSendingMessage;

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;

var s:string;
i,j:integer;
begin
result:=true;
//check the last 4 lines for %datetime% and replace it with the current
date time
for i:=message.count-4 to message.count-1 do
begin
if (i<0) then continue;
s:=message.strings[i];
j:=pos('%datetime%',s);
if j>0 then
begin
delete(s,j,length('%datetime%'));
insert(datetimetostr(now),s,j);
message.strings[i]:=s;
break;
end;
end;
end;

// neues Ereignis:
{$I Footnote_include.ds}

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
begin
result:=true;

result := doFootNoteNew ( Message );

//possibly some other calls to scripts

end;

begin
end.


_und im eigenen Script_ "Footnote_include.ds" (nur gespeichert und nicht
kompiliert:

//
// program Footnotes - Date: 2004/11/05
//

procedure Init_doFootNoteNew ( var ConstFootnoteHead : boolean;
var ConstFootnoteHeadTxt : String;
var ConstFootnoteHeadUnderline : String;
var ConstEmptyLine : Boolean;
var ConstEmptyLineBeforeFootnote : Boolean;
var ConstStartupFootnote : String;
var ConstEndFootnote : String;
var ConstReWrapEdge : Integer;
var ConstMultiLine : String;
var ConstRewrapToLine : String;
var ConstComments : String
);

begin

// ----------------------------------------------------
// Configuration settings
// ----------------------------------------------------

// Footnote-Support:
// configure your settings here:
//
// Set this to true, if you want a footnote-header like this:
// Footnotes:
// ==========
ConstFootnoteHead := true;

// Define the text, you want to see in your footnote-header.
ConstFootnoteHeadTxt := 'Footnotes:';

// Here you can define the character which should underline the
// footnote-header. If there should be no underline, just set
// "ConstFootnoteHeadUnderline = '';" (without double quotes).
ConstFootnoteHeadUnderline := '=';

// If there should be a blank line between footnote-header
// and footnotes,set this to "true". Otherwhise (false) there
// is no empty line between.
ConstEmptyLine := false;

// By default this script adds a blank line before the footnote block.
// Set this to false if you do not want the blank line.
ConstEmptyLineBeforeFootnote := true;

// Defines start-tag for footnote recognition.
// Everything after that (and between end-tag) is recogniced as
footnote.
ConstStartupFootnote := '#fn#';

// Defines end-tag of footnote recognation.
// Please use chars, you normaly not type inside your text.
ConstEndFootnote := '##';

// For longer footnotes its important to reformat the footnote.
// This number defines the column-number (should always be 1 char higher
// than inside Dialog). You will find this option in Settings -> General
// settings... -> Posting -> Wrap lines after xx chars
ConstReWrapEdge := 73;

// Defines a control character to expand the footnote to a blank line.
// Change it as your own wish.
ConstMultiLine := '%%';

// Define char(s) till which the paragraph will be reformated by the
// footnote-logic. Its very important if you want to use footnotes
// inside boxquotes, to put this at the end of your footnote!
ConstRewrapToLine := '<<';

// Useful if you want to talk about this footnote-skript inside 40tude
// Dialog, just comment them out. Note that the comment-chars will not
// be deleted in the article.
ConstComments := '//';

// ----------------------------------------------------
// End of configuration settings
// ----------------------------------------------------

end;

// --------------------------------------------------------------- //
// ---- No user maintainable parts below this line -------------- //
// --------------------------------------------------------------- //

//
// Flags to indicate the buttons contained in the message box:
//

// MB_OK = 0; // 1 button: OK.
// MB_OKCancel = 1; // 2 buttons: OK and Cancel.
// MB_AbortRetryIgnore = 2; // 3 buttons: Abort, Retry, and
Ignore.
// MB_VbYesNoCancel = 3; // 3 buttons: Yes, No, and
Cancel.
// MB_YesNo = 4; // 2 buttons: Yes and No.
// MB_RetryCancel = 5; // 2 buttons: Retry and Cancel.

//
// Flags to display an icon in the message box:
//

// MB_IconCritical = 16; // stop sign
// MB_IconQuestion = 32; // question mark
// MB_IconExclamation = 48; // exclamation point
// MB_IconInformation = 64; // lowercase i in a circle

function MessageBox( hWnd : Cardinal; lpText, lpCaption : PChar; uType :
longword ) : Integer;
external 'Messa...@user32.dll stdcall';


function GetText(
var Txt : TStringlist;
var FoundLine : Integer;
var FoundPosi : Integer;
var CurrLine : Integer;
var CurrPosi : Integer;
var ConstMultiL : String
) : String; // Function by Mirko D. Walter

var
res : String;
i : Integer;
bposi : Integer;
MaxInt : Integer;
begin
MaxInt := 2147483647;
result :='';
res := '';
if FoundLine = CurrLine then begin
res := Copy( txt.strings[foundline], FoundPosi, CurrPosi - FoundPosi
);
end
else begin
BPosi := FoundPosi;
for i := FoundLine to CurrLine do begin
if i < CurrLine then begin
res := Res + Trim( Copy(txt.strings[i], BPosi, MaxInt) ) + ' ';
BPosi := 0;
end
else begin
res := res + Copy( txt.strings[i], 1, CurrPosi-1 );
end;
end;
end;
//
// Multine-Special-Character?
//
BPosi := AnsiPos( ConstMultiL, res );
if BPosi > 0 then begin
repeat
//
// if the following characters are #13#10
// then do no linebreak, simply remove
// 1234567890123
// ABCDEF%%gaga#
//
if Copy( res, BPosi + Length(ConstMultiL), 2 ) = #13#10
then res := Copy( res, 1, BPosi - 1 )
+ #13#10
+ Trim( Copy(res, BPosi + Length(ConstMultiL),
MaxInt) )
else res := Copy( res, 1, BPosi - 1 )
+ #13#10
+ #13#10
+ Trim( Copy(res, BPosi + Length(ConstMultiL),
MaxInt) );
BPosi := AnsiPos( ConstMultiL, res );
until BPosi <= 0;
res := Trim( res );
end;
result := Trim( res );
end; // function GetText()


function Rewrap_Str(
StrL : String;
WEdge : Integer;
FootNote : Boolean;
ConstRewrap : String
) : String;

var
Space_Old : Integer;
Space_New : Integer;
i : Integer;
Space_Pos : Integer;
Break_L : Boolean;

begin
Space_Old := 1;
Space_New := 1;
Space_Pos := WEdge;
if Copy( StrL, Length(StrL), 1 ) <> ' '
then StrL := StrL + ' ';
if AnsiPos( ConstRewrap, StrL ) > 0
then Delete( StrL, AnsiPos(ConstRewrap, StrL), 2 );
for i:=1 to Length( StrL ) do begin
if (StrL[i] = ' ') and (i > 1) and (i < Length(StrL)) then begin
if StrL[i+1] = ' ' then begin // found double blank
if (StrL[i-1] <> '.') // it's perfectly fine to
and (StrL[i-1] <> '?') // have double blanks after
and (StrL[i-1] <> '!') // punctuation marks (at
and (StrL[i-1] <> ':') // least beyond sentence
and (StrL[i-1] <> ';') // delimiters).
then begin // but otherwise not!
Delete( StrL, i, 1 );
end;
end;
end;
end;
i := 0;
while i <= Length( StrL ) do begin
i := i + 1;
if (Copy(StrL, i, 1) = ' ')
or (Copy(StrL, i, 4) = (#13#10 + #13#10))
then begin
Break_L := false;
Space_Old := Space_New;
Space_New := i;
if Copy( StrL, i , 4 ) = (#13#10 + #13#10) then begin
Insert( ' ', StrL, i + 4 );
Break_L := true;
if Space_New < Space_Pos then begin
Space_Pos := i + 4 + WEdge;
Space_Old := i + 4;
Space_New := i + 4;
i := i + 4;
end;
end;
if (Space_New >= Space_Pos)
and (Space_old <= Space_Pos)
then begin
if (Space_New = Space_Pos)
and (Length(StrL) > Space_Pos)
then begin
if Footnote = false then begin
Delete( StrL, Space_New, 1 );
Insert( #13#10, StrL, Space_New );
Space_Pos := Space_New + WEdge + 1;
end
else begin
Insert( #13#10 + ' ', StrL, Space_New );
if Break_L then begin
Space_Pos := i + 4 + WEdge;
Space_Old := i + 4;
Space_New := i + 4;
i := i + 4;
end
else Space_Pos := Space_New + WEdge + 1;
i := i + 3;
end;
end
else begin
if Footnote = false then begin
if Length( StrL ) > Space_Pos then begin
Delete( StrL, Space_Old, 1 );
Insert( #13#10, StrL, Space_Old );
end;
Space_Pos := Space_Old + WEdge + 1;
if (Space_New >= Space_Pos)
and (Length(StrL) > Space_Pos)
then begin
Delete( StrL, Space_New + 1, 1 );
Insert( #13#10, StrL, Space_New + 1 );
Space_Pos := Space_New + WEdge + 2;
i := i + 1;
end;
end
else begin
if Space_Old > 5 then begin
if Length( StrL ) > Space_Pos
then Insert( #13#10 + ' ', StrL, Space_Old );
if Break_L then begin
Space_Pos := i + 4 + WEdge;
Space_Old := i + 4;
Space_New := i + 4;
i := i + 4;
end
else begin
Space_Pos := Space_Old + WEdge + 1;
if Space_New >= Space_Pos then begin
Insert( #13#10 + ' ', StrL, Space_New + 5 );
Space_Pos := Space_New + WEdge + 6;
end;
end;
i := i + 3;
end
else begin
Insert( #13#10 + ' ', StrL, Space_New );
Space_Pos := Space_New + WEdge + 1;
i := i + 3;
end;
end;
end;
i := i + 1;
end;
end;
end; // while
result := TrimRight( StrL );
end; // function Rewrap_Str()


function doFootNoteNew(
var Message : TStringlist
) : Boolean; // is message ok?

var
ConstFootnoteHead : boolean;
ConstFootnoteHeadTxt : String;
ConstFootnoteHeadUnderline : String;
ConstEmptyLine : boolean;
ConstEmptyLineBeforeFootnote : Boolean;
ConstStartupFootnote : String;
ConstEndFootnote : String;
ConstReWrapEdge : Integer;
ConstMultiLine : String;
ConstRewrapToLine : String;
ConstComments : String;
i : Integer;
Posi : Integer;
Mult_Posi : Integer;
FoundLine : Integer;
FoundPosi : Integer;
OLength : Integer;
RFoundPosi : Integer;
Rest : String;
FN_Temp : String;
FN : String;
FNR : Integer;
Skip : Boolean;
Sig : Boolean;
txt2 : String;
txt3 : String;
Temp_Str : String;
Add_txt3 : Boolean;
FootnoteStr : String;
zw : Integer;
MB_OK : LongWord;
MB_IconExclamation : LongWord;
MaxInt : Integer;

begin
Init_doFootNoteNew ( ConstFootnoteHead, ConstFootnoteHeadTxt,
ConstFootnoteHeadUnderline,
ConstEmptyLine, ConstEmptyLineBeforeFootnote,
ConstStartupFootnote,
ConstEndFootnote, ConstReWrapEdge, ConstMultiLine,
ConstRewrapToLine,
ConstComments );
result := false;
if ConstFootnoteHead then begin
if Length( ConstFootnoteHeadUnderline ) = 1 then begin
for i := 1 to Length( ConstFootnoteHeadTxt ) do begin
FootnoteStr := FootnoteStr + ConstFootnoteHeadUnderline;
end;
end
else FootnoteStr := '';
end
else FootnoteStr := '';

i := -1;
posi := -1;
foundposi := -1;
rest := '';
fn := '';
sig := false;
fnr := 0;
txt2 := '';
txt3 := '';
Mult_Posi := -1;
Add_Txt3 := false;
FN_Temp := '';
Temp_Str := '';
MB_OK := 0;
MB_IconExclamation := 48;
MaxInt := 2147483647;
while (i <= message.count-1) and (sig = false) do begin
if Rest = '' then begin
i := i + 1;
// ignore quotes and empty lines
Skip := true;
while Skip and (i <= message.count - 1) do begin
Skip := false;
if Sig then begin
txt2 := txt2 + message.strings[i] + #13#10;
i := i + 1;
Skip := true;
end
else begin
if Length( message.strings[i] ) > 0 then begin
if Copy( message.strings[i], 1, 1 ) = '>' then begin
txt2 := txt2 + message.strings[i] + #13#10;
i := i + 1;
Skip := true;
end;
if Length( message.strings[i] ) > 2 then begin
if Copy( message.strings[i], 1, 3 ) = '-- ' then begin
if Length( FN ) > 0 then begin
WriteToLog('FN: >' + FN + '<', 7);
if ConstEmptyLineBeforeFootnote = true then
begin
txt2 := txt2 + #13#10 + FN;
end
else begin
txt2 := txt2 + FN;
end;
end;
Sig := true;
Skip := true;
end;
end;
end
else begin
txt2 := txt2 + message.strings[i] + #13#10;
i := i + 1;
Skip := true;
end;
end;
end;
if i > message.count-1 then break; // fix added by MM
(Oct. 30th, 2003)
Rest := message.strings[i];
OLength := Length(Rest);
end;
if not Sig then begin
if FoundPosi > 0 then begin
Posi := AnsiPos( ConstEndFootNote, Rest );
if Posi > 0 then begin
Mult_Posi := AnsiPos( ConstStartupFootnote, Rest );
if (i + 1) = message.count
then Temp_Str := ''
else Temp_Str := message.strings[i + 1];
if (AnsiPos(ConstRewrapToLine, Rest) > 0)
or (Temp_Str = '')
or (Temp_Str = '-- ')
then begin
Add_Txt3 := false;
if Mult_Posi = 0 then begin
if AnsiPos( ConstRewrapToLine, Rest ) > 0
then txt3 := txt3
+ Copy( Rest,
posi+Length(ConstEndFootnote),
AnsiPos(ConstRewrapToLine,
Rest)+1 )
else txt3 := txt3
+ Copy( Rest,
posi+Length(ConstEndFootnote), MaxInt );
end;
end
else Add_Txt3 := true;
zw := posi + olength - Length( rest );
FN_Temp := '[' + IntToStr(FNR) + '] '
+ GetText( message, FoundLine, FoundPosi, i, zw,
ConstMultiLine);
FN_Temp := Rewrap_Str( FN_Temp, ConstReWrapEdge, true,
ConstRewrapToLine );
if (FN = '')
and (FN_Temp <> '')
and (ConstFootnoteHead = true)
then begin
if FootnoteStr <> ''
then FN := ConstFootnoteHeadTxt + #13#10 + FootnoteStr
+ #13#10
else FN := ConstFootnoteHeadTxt + #13#10;
if ConstEmptyLine = true then FN := FN + #13#10;
end;
FN := FN + FN_Temp + #13#10;
// FN := FN
// + '[' + IntToStr(FNR) + '] '
// + GetText(message, FoundLine, FoundPosi, i, zw) +
#13#10;
Rest := Copy( Rest,posi+Length(ConstEndFootnote), MaxInt );
If Rest = '' then Rest := ' '; //08.10.2004 !!
FoundPosi := -1;
Mult_Posi := -1;
end
else begin
Rest:='';
end;
end
else begin
// WriteToLog('R: ' + Rest, 7);
// 1. char = #, ignore this, could be a control character
if Copy( Rest + ' ', 1, Length(ConstComments) ) <>
ConstComments then begin
Posi := AnsiPos(ConstStartupFootnote, Rest);
if Posi > 0 then begin
// WriteToLog('FN: ' + IntToStr(Posi), 7);
RFoundPosi := Posi + Length( ConstStartupFootnote );
FoundPosi := RFoundPosi + OLength - Length( Rest );
FoundLine := i;
FNR := FNR + 1;
// txt2 := txt2 + Copy( Rest, 1, Posi - 1 ) + '[' +
IntToStr(FNR) + ']';
txt3 := txt3 + Copy( Rest, 1, Posi - 1 ) + '[' +
IntToStr(FNR) + ']';
Rest := Copy( Rest, RFoundPosi, MaxInt ); //
08.10.2004 Trim entfernt
end
else begin
if FoundPosi = -1 then begin
if Add_Txt3 then txt3 := txt3 + Rest + ' ';
if (i + 1) = message.count
then Temp_Str := ''
else Temp_Str := message.strings[i + 1];
if ( (AnsiPos(ConstRewrapToLine, Rest) > 0)
or (Temp_Str = '') or (Temp_Str = '-- '))
and (txt3 <> '')
then begin
Add_Txt3 := false;
txt3 := Rewrap_Str( txt3, ConstReWrapEdge, false,
ConstRewrapToLine );
txt2 := txt2 + txt3;
txt3 := '';
Rest := '';
end;
if Add_Txt3 = false then txt2 := txt2 + Rest + #13#10;
Rest := '';
end;
end;
end
else begin
txt2 := txt2 + Rest + #13#10;
Rest := '';
end;
end;
end;
end;
if txt3 = '' then begin
result := true;
if Sig = false then begin
if Length( FN ) > 0 then begin
message.text := txt2 + #13#10 + FN;
end;
end
else message.text := txt2;
end
else begin
message.text := message.text;
result := false;
MessageBox( 0, 'End-Tag ''' + ConstEndFootnote + ''' of footnote not
found!',
'Abort sending!', MB_OK or MB_IconExclamation );
end;
end; // function doFootNoteNew()

Das obere Script habe ich kompiliert und folgende Error-Meldung bekommen:
Kompilieren fehlgeschlagen
[Error] OnBeforeSendingMessage.ds(27:10): Duplicate identifier
'ONBEFORESENDINGMESSAGE'

Ich weiß, es nervt Euch, aber wo liegt da mein Fehler?
Danke für die Geduld
Jörg

P.S. Vom Pragrammieren habe ich wirklich nicht den geringsten Schimmer
einer Ahnung *verlegengrins*

Korbinian Abenthum

unread,
Apr 13, 2005, 1:40:24 PM4/13/05
to
Joerg Fimpel-Janning wrote:
> Quote [*Joerg Fimpel-Janning* schrieb am 13.4.05 - 09:48h]
>
> Also, das ist ja nicht so einfach mit mir :-(
>
> Ich habe nun im "OnBeforeSending..." stehen:
> program OnBeforeSendingMessage;

Hmm, Du hast die Anweisungen in der Wiki falsch verstanden: Wenn Du schon
ein bestehendes Event-Script hast (in Deinem Fall ein bestehendes
OnBeforeSending-Script), dann musst Du die beiden in der Wiki beschriebene
Zeilen in dieses *einfügen*, und *nicht* das dann folgende Beispiel komplett
*anhängen*.
Das Endergebnis muss bei Dir wie folgt aussehen:

_________

program OnBeforeSendingMessage;

{$I Footnote_include.ds}
//bitte hier im Falle weitere OBSending-Include-Scripte einbinden per {$I ...}, wie im Wiki angegeben

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
var s:string;
i,j:integer;
begin
result:=true;

result := doFootNoteNew ( Message );

//bitte hier im Falle weitere OBSending-Include-Aufrufe einbinden, wie im Wiki angegeben

// Nur so nebenbei: Die folgenden Zeilen könnte man auch mit dem
// ReplaceArbitrarySubstrings-Include-Script etwas umfassender und
// globaler realisieren.
// Wäre aber zugegeben overkill, wenn Dir die Funktion unten ausreicht
// :) </Eigenwerbung>

//check the last 4 lines for %datetime% and replace it with the current date time
for i:=message.count-4 to message.count-1 do
begin
if (i<0) then continue;
s:=message.strings[i];
j:=pos('%datetime%',s);
if j>0 then
begin
delete(s,j,length('%datetime%'));
insert(datetimetostr(now),s,j);
message.strings[i]:=s;
break;
end;
end;
end;

begin
end.

______
Natürlich ungetestet, ich hoffe ich habe nix verschusselt.

> _und im eigenen Script_ "Footnote_include.ds" (nur gespeichert und nicht
> kompiliert:

Brav :)
Donst wäre Dein Computer explodiert ;)
Das scheint jedenfalls perfekt zu sein, ich habe es aber nicht wirklich
angeschaut.

--
"If you would take a man's life, you owe it to him to look into his eyes
and hear his final words. And if you cannot bear to do that, then perhaps
the man does not deserve to die." (Eddard Stark)

Nico Haase

unread,
Apr 13, 2005, 1:50:22 PM4/13/05
to
Moin,
*Joerg Fimpel-Janning* schrub:

HA! Das sind ja zwei OnBeforeSendingMessage-Scripte. Welches
aufgerufen wird, weiß ich nicht, aber stells mal so um:

Ich habe nun im "OnBeforeSending..." stehen:
program OnBeforeSendingMessage;

// neues Ereignis:
{$I Footnote_include.ds}

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
begin
result:=true;

result := doFootNoteNew ( Message );

//check the last 4 lines for %datetime% and replace it with the current date time


for i:=message.count-4 to message.count-1 do
begin
if (i<0) then continue;
s:=message.strings[i];
j:=pos('%datetime%',s);
if j>0 then
begin
delete(s,j,length('%datetime%'));
insert(datetimetostr(now),s,j);
message.strings[i]:=s;
break;
end;
end;

//possibly some other calls to scripts

end;

begin
end.

Dann sollte es gehen, wobei ich mich frage, was das andere Script
macht - soll mir aber Wurscht sein ;)
mfg
Nico

--
www.buchtips.net - Rezensionen online

Korbinian Abenthum

unread,
Apr 13, 2005, 3:03:07 PM4/13/05
to
Ingrid Abenthum wrote:

> // Nur so nebenbei: Die folgenden Zeilen könnte man auch mit dem
> // ReplaceArbitrarySubstrings-Include-Script etwas umfassender und
> // globaler realisieren.

Öhm, das kannst Du streichen. Ich war kurz geistig abwesend.

Korbinian, nur die Ingrid-Statistik im Kopf ... ;)

--
"You're awful."
"I'm honest. It's the world that's awful."

Joerg Fimpel-Janning

unread,
Apr 13, 2005, 3:34:36 PM4/13/05
to
Quote [*Nico Haase* schrieb am 13.4.05 - 19:50h]

>
> HA! Das sind ja zwei OnBeforeSendingMessage-Scripte. Welches
> aufgerufen wird, weiß ich nicht, aber stells mal so um:

> ...


> Dann sollte es gehen, wobei ich mich frage, was das andere Script

> macht ...

Hi Nico [1] ich hab´s getestet (diesmal in der Testgruppe *ggg*) und es
scheint zu funktionieren das weiß ich auch nicht mehr und ich hab´s auch
rausgeschmissen, da ich immer noch nicht kapiert hatte, wie man beide
Scripte ans Laufen kriegt. Mal sehen, welches Feature ich morgen
vermisse ;-) Noch Mal danke an Alle (Mann, hoffentlich klappt´s nun auch
wirklich noch Mal) Gruß Jörg

Footnotes:
==========
[1] ... und natürlich auch Korbinian!

Korbinian Abenthum

unread,
Apr 13, 2005, 4:25:18 PM4/13/05
to
Joerg Fimpel-Janning wrote:
> Quote [*Nico Haase* schrieb am 13.4.05 - 19:50h]

>> Dann sollte es gehen, wobei ich mich frage, was das andere Script
>> macht ...

> das weiß ich auch nicht mehr und ich hab´s auch rausgeschmissen, da ich


> immer noch nicht kapiert hatte, wie man beide Scripte ans Laufen kriegt.

Das wäre schon beides parallel gelaufen.

> Mal sehen, welches Feature ich morgen vermisse

Dass Du in den letzten 4 Zeilen Deiner Artikel nicht mehr %datetime%
hinschreiben kannst, was dann automagisch durch das aktuelle Datum und Zeit
ersetzt würde.

> [1] ... und natürlich auch Korbinian!

Bitte bitte. Maik, denkst Du daran, diese Antwort von Joerg in der Statistik
zur Hälfte mir gutzuschreiben?
GDNRVVF

--
"Can a man still be brave if he's afraid?"
"That is the only time a man can be brave."

Maik Prinz

unread,
Apr 13, 2005, 4:59:31 PM4/13/05
to
* am Mi, 13. Apr. 2005 um 22:25 war von Korbinian Abenthum zu lesen...
[1 Artikel für mehrere Anreden/Danksagungen]

>> [1] ... und natürlich auch Korbinian!
> Bitte bitte. Maik, denkst Du daran, diese Antwort von Joerg in der Statistik
> zur Hälfte mir gutzuschreiben?

Auwei, schon wieder eine neue Idee - komm gar nicht mehr hinterher. *gg*
Dieser[1] ist dann aber sogar durch 3 zu teilen... ;-)

> GDNRVVF

Dich habe ich doch schon vor 2 Monaten eingeholt. SCNR


cu, Maik

Footnotes:
¯¯¯¯¯¯¯¯¯¯
[1] <news:1211rf8t00e3u$.h0dswwrigx6w$.d...@40tude.net>
--
250+ 3D Wallpaper: http://www.2prinz.de

0 new messages