AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Fehler beim allowup

Ein Thema von moperswings · begonnen am 12. Jun 2007 · letzter Beitrag vom 12. Jun 2007
 
moperswings

Registriert seit: 27. Mai 2004
Ort: Bad Sooden-Allendorf
240 Beiträge
 
Delphi 6 Professional
 
#5

Re: Fehler beim allowup

  Alt 12. Jun 2007, 10:52
Mit Kanone auf Spatz geschossen - aber getroffen:
Delphi-Quellcode:
function findtextall(re: TRichEdit; sText: string; options:TSearchTypes): TIntegerdynarray;
var
        istart, ifound, ilength: integer;
begin
        setlength(result, 0);
        istart := 0;
        ilength := length(re.Lines.Text);
        while istart < (ilength - length(stext)) do
        begin
          ifound := re.FindText(sText, istart, ilength - istart, options);
          if ifound = - 1 then
          exit;
          Setlength(Result, succ(length(result)));
          result[high(result)] := ifound;
          istart := ifound + length(stext);
        end;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
        x: integer;
        s: string;
        ida: TIntegerDynArray;
begin
        If SpeedButton1.Down = true then
        RichEdit1.SelText := '[b]' + RichEdit1.SelText + '[/b]';

        If Speedbutton1.Down = false then
        begin
          RichEdit1.SelText := StringReplace(RichEdit1.SelText,'[b]', '', [RfReplaceAll]);

          s := '[/b]';
          ida := findtextall(RichEdit1, s, []);
          for x := low(ida) to high(ida) do
          with RichEdit1 do
          begin
            selstart := ida[x];
            sellength := length(s);
            seltext := '';
          end;
          RichEdit1.SetFocus;
        end;
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:13 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz