Trying to work out what the debugger is telling me with a compiling error after I added a procedure to my current project, and a few suggestions on how to trace the issue to find the problem is in order. The procedure I added is:
procedure TCustomerForm.DataSourceCustDataChange(Sender: TObject);
var
i,j: integer;
begin
For i:= 0 to PageControl1.ActivePage.ComponentCount-1 do
If PageControl1.ActivePage.Components[i] is TCustFrame then
CustActiveFrame:= (PageControl1.ActivePage.Components[i] as TCustFrame);
If CustActiveFrame.CheckBoxEditMode.Checked then exit; // Tab in edit mode
With CustActiveFrame do
begin
For j:= 0 to 43 do
begin
with TMemo(FindComponent('Memo'+IntToStr(j))) do
begin
Text:=DataModule1.DataSourceCust.DataSet.Fields[j].DisplayText;
end;
end;
end;
end;
This is to get the contents of all fields in my customer dBase table, located in DataModule1, accessed via the datasource dataset, and write them to a series of TMemo boxes located within a frame which is added to dynamically generated tabsheets at runtime (the tabs creation & frame with memo boxes adding works fine), and is fired by the OnDataChange event of the table to update the memo boxes when the record pointer moves.
When I compile, it throws up an error of:
.. raised exception class 'EReadError' with message:
Invalid value for property
At address 441C08
The debugger opens up the LResources unit and highlights line 3156 which reads:
Reader.ReadRootComponent(Instance);
Hovering over Instance shows that it is holding <TDATAMODULE1>, so there is some sort of error there, but I can't see what it might be.
Any advice on how to interpret things further would be helpful.
Thanks in advance