|Subject:||Re: Can not assign a nil to a TIdScoketHandles|
|Posted by:||Remy Lebeau (Indy Team) (firstname.lastname@example.org)|
|Date:||Mon, 9 Oct 2006|
"Grant Brown" <gra…@sitedoc.com.au> wrote in message
> I am trying to create a TIdCmdTCPServer in code at runtime and I get
> the following error.
> "Can not assign a nil to a TIdScoketHandles"
As you should be, because your code is wrong.
> Bindings := nil;
That is your problem. The Bindings property exposes an object, so it has a
setter method that calls the object's Assign() method.
TIdSocketHandles.Assign() cannot be passed a nil pointer (just like most
Assign() methods in the VCL in general cannot). Why are you assigning nil
to the Bindings in the first place? The Bindings is already empty since you
just created the server object.
> ReplyTexts := nil;
You cannot do that, either, for the same reason as above.
Can not assign a nil to a TIdScoketHandles posted by Grant Brown on Sat, 7 Oct 2006