Dynamic TppFields
Hello,
I create TppFields dynamicly :
procedure CreateJitFields ;
var
NewField : TppField ;
begin
for k:=1 to myGrid.Columns do begin
NewField := TppField.Create(self) ;
NewField.Fieldname := myGrid.ColumnTitle[k] ;
myJITPipeline.AddField(NewField) ;
end;
end;
This works fine, but I get an AccessViolation when closing my App.
I tried several Owners (nil, self, myJITPipeline)...
What do I do wrong,
kind regards,
Dirk Janssens.
I create TppFields dynamicly :
procedure CreateJitFields ;
var
NewField : TppField ;
begin
for k:=1 to myGrid.Columns do begin
NewField := TppField.Create(self) ;
NewField.Fieldname := myGrid.ColumnTitle[k] ;
myJITPipeline.AddField(NewField) ;
end;
end;
This works fine, but I get an AccessViolation when closing my App.
I tried several Owners (nil, self, myJITPipeline)...
What do I do wrong,
kind regards,
Dirk Janssens.
This discussion has been closed.
Comments
1. There is a DataPipeline.DefineFields method that you can call to create
fields dynamically.
function DataPipeline.DefineField(aFieldName: String; aDataType:
TppDataType; aFieldLength: Integer): Integer;
example:
ppJITPipeline1.DefineField('Company', dtString, 30);
2. To make your existing example code work properly. Replace
myDataPipeline.AddField(myField);
with
myField.DataPipeline := myDataPipeline;
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com