I am using Indy 10(TIdTcpServer) and I get the following error:
[DCC Error] MainForm.pas(88): E2066 Missing operator or semicolon
When trying to run this code:
procedure TForm1.SendMessage(Data: String; Client: Integer);
var
List: TList;
AContext: TIdContext;
begin
List := idTcpServer1.Contexts.LockList;
AContext(List[0]).Connection.IOHandler.WriteLn(Data); // Line 88
end;
I cannot figure out what I am missing; any help?
While I can't explain the error you're getting, your code is totally wrong.
Change it to:
procedure TForm1.SendMessage(Data: String; Client: Integer);
var
List: TList;
AContext: TIdContext;
begin
List := idTcpServer1.Contexts.LockList;
AContext := TIdContext(List[0]);
AContext.Connection.IOHandler.WriteLn(Data);
end;
Your bad use of the typecast with a non-type may be confusing the compiler. If that doesn't solve it, please edit your question to add more code around what you've posted (the dozen or so lines before what you've posted would help).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With