Re: Can not assign a nil to a TIdScoketHandles

Giganews Newsgroups
Subject: Re: Can not assign a nil to a TIdScoketHandles
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Mon, 9 Oct 2006

"Grant Brown" <gra…@sitedoc.com.au> wrote in message
news:28ABFCFDAD0AE340gra…@sitedoc.com.au...

> 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.

Gambit

Replies

None

In response to

Can not assign a nil to a TIdScoketHandles posted by Grant Brown on Sat, 7 Oct 2006