ikaros23
asked on
Problem in a Component derived from TClientDataSet using TStrings
Hello ,
I want to create a Custom Component based on the TClientDataset class. I want my new component to be able to hold some strings in a TstringList. I have used the same technique in some other components and worked fine. No when I am trying to open the TStrings Editor in the Object Inspector the following error message appears "Could not assign a nil to a TRichEditStrings". What may be wrong ?
Thank you in advance.
I want to create a Custom Component based on the TClientDataset class. I want my new component to be able to hold some strings in a TstringList. I have used the same technique in some other components and worked fine. No when I am trying to open the TStrings Editor in the Object Inspector the following error message appears "Could not assign a nil to a TRichEditStrings". What may be wrong ?
Thank you in advance.
TMySecondClientDataset = class(TClientDataSet)
private
FFileGroups: TStrings;
protected
constructor Create(AOwner : TComponent);
destructor Destroy;
public
published
property FileGroups: TStrings read FFileGroups write FFileGroups;
end;
constructor TMySecondClientDataset.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FFileGroups := TStringList.Create;
end;
destructor TMySecondClientDataset.Destroy;
begin
FFileGroups.Free;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
did you assign nil ?
you want to assign the content of the list ,
not the list itself
you want to assign the content of the list ,
not the list itself
ASKER
Your setter procedure was right. What I though was right in the components I told you I have used the same technique proved to be wrong.I had written a property editor to access the strings . when I used the default the same error occurred. Although I have used a slightly different approach than the one you suggested (taken by FSQL property of ADOQuery) , I am accepting your solution , because its essentially the same. Thank you very much,
but why then a B grade ?
ASKER
Sorry for the B . I am new to the experts and placed a B by mistake ... SORRYYYY :(
lol, no need to apologize, i was just wandering why ...
just follow the guide lines.
post a A, when accept,
post a B when you had to solve yourself and further investigation didn't help
post a C ... nobody likes this ...
just follow the guide lines.
post a A, when accept,
post a B when you had to solve yourself and further investigation didn't help
post a C ... nobody likes this ...
ASKER