Delphi初心者のための寺子屋at TECH
Delphi初心者のための寺子屋 - 暇つぶし2ch62:デフォルトの名無しさん
05/12/07 01:04:33
>>61
begin
    cnt:=0;
    spos:=0;

    str:=RichEdit1.Text;
    PStr:=PChar(str);
    len:=Length(sword);

    repeat
        p:=AnsiPos(sword, PStr+spos);

        if (p>0) then
        begin
            Inc(cnt);
            Inc(spos, p);

            with RichEdit1 do
            begin
                SelStart:=spos-1;
                SelLength:=len;
                SelAttributes.Color:=clRed;
            end;
            Inc(spos, len);

        end;

    until p=0;
    ShowMessage(IntToStr(cnt));
end;
//ここまで
よろしくお願いします。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch