Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

assigning procedures in a console app

0 views
Skip to first unread message

adet

unread,
Aug 4, 2002, 2:47:07 PM8/4/02
to
Hi guys any way i can assign procedures like

procedure TForm1.IdTCPClient1Status(axSender: TObject;
const axStatus: TIdStatus; const asStatusText: String);
begin

end;


but in a console app.


The console apps dont appear to like

type
procedure TForm1.IdTCPClient1Status(axSender: TObject; const axStatus:
TIdStatus; const asStatusText: String);

or
public
procedure TForm1.IdTCPClient1Status(axSender: TObject; const axStatus:
TIdStatus; const asStatusText: String);


so how can i get these events to work in console or how can i assign them
like delphi ide does on a form is it at all possible ?

adet


J. Peter Mugaas

unread,
Aug 4, 2002, 3:42:43 PM8/4/02
to
[This followup was posted to borland.public.delphi.internet.winsock and
a copy was sent to the cited author.]

In article <3d4d76ab$1_2@dnews>, adrian...@ntlworld.com says...


> Hi guys any way i can assign procedures like
>
> procedure TForm1.IdTCPClient1Status(axSender: TObject;
> const axStatus: TIdStatus; const asStatusText: String);
> begin
>
> end;
>
>
> but in a console app.
>

One way I would suggest would be something like this:

type
TDummyObject = class(TOBject)
public
procedure IdTCPClient1Status(axSender: TObject;

const axStatus: TIdStatus; const asStatusText: String);

end;

var d : TDummyObject;
begin
d := TDummyObject.Create;
try
IdTCPClient1.OnStatus := d.IdTCPClient1Status;
{Whatever}
finally
d.Free;
end;
end.


--
J. Peter Mugaas - Chairperson, Distribution Team, Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you. Otherwise, do
not contact me.

0 new messages