equivalent of GetParText

  • Zitat

    I'm continuing to work my way through WPTools 5, converting my main(WPTools 3) project over.
    What is the WPTools 5 equivalent of<TWPRichText>.GetParText?

    WPTools 5 usually does not work with paragraph indexes any more. Usually you should try to work with TParagraph references.

    To convert code which uses the old
    function GetParText(Index: Longint; Buffer: Pchar; Size: Integer): Integer;

    I suggest to create code like this:

    From R4 this function will be available to assit you:

    function TWPCustomRtfEdit.GetPar(ParIndex : Integer) : TParagraph;
    begin
    Result := FirstPar;
    while (Result<>nil) and (ParIndex>0) do
    begin Result := Result.next; dec(ParIndex); end;
    end;