ZitatI'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:
Code
procedure TWP5WordPad.Button1Click(Sender: TObject);
var par : TParagraph;
index : Integer;
begin
index := 3; //<------ the index
par := WPRichText1.FirstPar;
while (par<>nil) and (index>0) do
begin par := par.next; dec(index); end;
if par<>nil then
ShowMessage(par.GetText);
end;
Alles anzeigen
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;