IPB

Willkommen, Gast ( Anmelden | Registrierung )

 
Reply to this topicStart new topic
> Plugins mit Free-Pascal erstellen
meybohm
Beitrag 13.03.2004 - 13:15
Beitrag #1


is getting harder


Gruppe: User
Beiträge: 12
Mitglied seit: 31.10.2001
Mitglieds-Nr.: 6



QUELLTEXT
{

delete_html_tags.pas



Dieses Plugin löscht alle HTML-Tags innerhalb des geöffneten

Proton-Dokuments bzw. innerhalb des markierten Textes.



Beispielplugin

Proton Plugins mit dem Free Pascal Compiler erstellen.

Zum kompilieren folgenden Befehl aufrufen:

c:ppbinwin32ppc386 -Sd delete_html_tags.pas



Hinweis:

Um Proton als Free-Pascal IDE zu nutzen, einfach

folgenden Shortcut in den Programmeinstellungen

definieren:

command.com /k c:ppbinwin32ppc386 -Sd %A%

}



library delete_html_tags;



uses

 regexpr;



const KEINE_RUECKGABE=0;

     RUECKGABE_ERSETZT_MARKIERUNG = 1;

     RUECKGABE_ERSETZT_EDITORTEXT = 2;



var RUECKGABETYP:integer;



function pluginStart(text:pchar; selstart,sellength:integer) : pchar;  export;stdcall;

var

  r : tregexprengine;

  i,len : longint;

  s:string;

begin

r:=GenerateRegExprEngine('<[^>]+>',[]);

SetString(s,text,strlen(text));

if (sellength=0) then

 RUECKGABETYP:=RUECKGABE_ERSETZT_EDITORTEXT

else

    begin

 s:=copy(s,selstart+1,sellength);

 RUECKGABETYP:=RUECKGABE_ERSETZT_MARKIERUNG;

    end;

while RegExprPos(r,pchar(s),i,len) do

    begin

 delete(s,i+1,len);

    end;

DestroyregExprEngine(r);

pluginStart := pchar(s);

end;



function pluginRueckgabetyp:Integer;export;stdcall;

begin

 pluginRueckgabetyp :=RUECKGABETYP;

end;



function pluginInterfaceVersion: integer; export;stdcall;

begin

 pluginInterfaceVersion := 1;

end;



exports

pluginRueckgabetyp,

pluginStart,

pluginInterfaceVersion;



end.
[/code]
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 Besucher lesen dieses Thema (Gäste: 1 | Anonyme Besucher: 0)
0 Mitglieder:

 



RSS Vereinfachte Darstellung Aktuelles Datum: 27.04.2024 - 20:33

taschenkalender
expertise-panel IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here