Delphi 2007, WPTools [V5.51], Windows Vista
The one page document has plain text (nothing fancy) and Hyperlink objects that were created using: WPEditor.InputHyperlink() at runtime. There are no other text objects in the document that I am aware of. Document starts as plain text (e.g., text copied from Notepad - so, there is no HTML or RTF markup when text is loaded into WPEditor).
procedure TForm1.TestClick(Sender: TObject);var aTextObjList : TWPTextObjList ; i, nObjCount : Integer ;begin WPEditor.FieldGetList(aTextObjList, True, '') ; // [b]<-- Access Violation[/b] // Other code intended to loop through objects - Never reached.end ;
Eurekalog points the error to this line:
List._StringParam := NameStartWith;
procedure TWPCustomRtfEdit.FieldGetList(
list: TWPTextObjList; FromAllBlock: Boolean = FALSE;
NameStartWith: string = '');
begin
List.Clear;
List._StringParam := NameStartWith;
if FromAllBlock then Memo.RTFData.LoopAllObj(List, LoopFieldsB, nil)
else Memo.RTFData.LoopAllObj(List, LoopFieldsB, Memo.DisplayedText);
end;
What am I doing wrong? Even if there are zero objects, I should get a blank list, and not an Access Violation.
I need to get list of ALL Hyperlink objects and be able to loop through to conditionally change Source text and changes Source text's color. Any help to accomplish that will be appreciated.
Thank you
JayM (occasional WPTools user)