", but". " found." After adding IdUDPServer to my form and trying to insert some code into the OnUDPRead e...">

Delphi XE Code Parser Error: "Expected"> ", but". " found."

After adding IdUDPServer to my form and trying to insert some code into the OnUDPRead event, I cannot add any component to my form at design time and cannot start the application.

this is the error i'm getting

is there any way to solve this?

+4
source share
1 answer

There are two errors in this error handler. To fix them, you can

  • delete the System. from TArray<System.Byte> (in interface and implementation)
  • add IdSocketHandle to use list in interface

I have not researched yet, but after these changes, the code can be compiled.

So the full code will be

 unit Unit12; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdSocketHandle, // <-- added IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient, IdUDPServer; type TForm12 = class(TForm) IdUDPClient1: TIdUDPClient; IdUDPServer1: TIdUDPServer; procedure IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; AData: TArray<Byte>; ABinding: TIdSocketHandle); private { Private declarations } public { Public declarations } end; var Form12: TForm12; implementation {$R *.dfm} procedure TForm12.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; AData: TArray<Byte>; ABinding: TIdSocketHandle); begin // end; 
+1
source

All Articles