немного изменил код
unit yadro;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, IdUDPClient,
IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer, FMX.StdCtrls, FMX.Edit,
FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo, IdGlobal, IdSocketHandle,
FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf,
FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Phys, FireDAC.Stan.Pool,
FireDAC.Stan.Async, FireDAC.Phys.MSAcc, FireDAC.Phys.MSAccDef,
FireDAC.FMXUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf,
FireDAC.DApt, System.Rtti, FMX.Grid.Style, Data.Bind.EngExt,
Fmx.Bind.DBEngExt, Fmx.Bind.Grid, System.Bindings.Outputs, Fmx.Bind.Editors,
Data.Bind.Components, Data.Bind.Grid, Data.Bind.DBScope, FMX.Grid, Data.DB,
FireDAC.Comp.DataSet, FireDAC.Comp.Client;
type
TForm2 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
IdUDPServer1: TIdUDPServer;
Server_On: TButton;
Server_Off: TButton;
Label2: TLabel;
Timer1: TTimer;
FDConnection1: TFDConnection;
FDQuery1: TFDQuery;
DataSource1: TDataSource;
StringGrid1: TStringGrid;
BindSourceDB1: TBindSourceDB;
BindingsList1: TBindingsList;
LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource;
Isert: TButton;
Post: TButton;
delete: TButton;
Button7: TButton;
loginbind: TEdit;
passwordbind: TEdit;
Groupebind: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Timer2: TTimer;
LinkControlToField1: TLinkControlToField;
LinkControlToField2: TLinkControlToField;
LinkControlToField3: TLinkControlToField;
LinkControlToField4: TLinkControlToField;
Label3: TLabel;
Label4: TLabel;
procedure IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: TIdBytes; ABinding: TIdSocketHandle);
procedure Server_OnClick(Sender: TObject);
procedure Server_OffClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure IsertClick(Sender: TObject);
procedure PostClick(Sender: TObject);
procedure deleteClick(Sender: TObject);
procedure Openstr();
procedure Closestr();
procedure loginbindChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
S:string;
text,comand,comandtext:String;
d:integer;
LoginNofind:boolean;
implementation
{$R *.fmx}
procedure TForm2.Server_OnClick(Sender: TObject);
begin
Form2.IdUDPServer1.Active:=true;
end;
procedure TForm2.Server_OffClick(Sender: TObject);
begin
Form2.IdUDPServer1.Active:=false;
end;
procedure TForm2.IsertClick(Sender: TObject);
begin
FDQuery1.Insert;
end;
procedure TForm2.loginbindChange(Sender: TObject);
begin
if (FDQuery1.DataSource.DataSet.Locate('Login',text,[loCaseInsensitive])) then
begin
D:=1002;
LoginNofind:=true;
end
else
begin
loginbind.Text:='';
passwordbind.Text:='';
groupebind.Text:='';
end;
end;
procedure TForm2.PostClick(Sender: TObject);
begin
FDQuery1.Post;
end;
procedure TForm2.deleteClick(Sender: TObject);
begin
FDQuery1.Delete;
end;
procedure TForm2.Closestr;
begin
FDQuery1.Post;
end;
procedure TForm2.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: TIdBytes; ABinding: TIdSocketHandle);
var
ss:TStringStream; //сохранять буквы будем тут
s,buff:String; //вспомогательные переменные
begin
ss:=TStringStream.create(''); //создаем пустую строку
ss.write(adata[0],length(adata)); //записываем в нее данные из потока байт
s:=ss.DataString; //преобразовываем ее в текст
ss:=TStringStream.create(''); //создаем пустую строку
ss.write(adata[0],length(adata)); //записываем в нее данные из потока байт
s:=ss.DataString; //преобразовываем ее в текст
Memo1.Lines.Add(s); // если кракоз¤бры то пробуем Utf8ToAnsi и т д (но у мен¤ и так работает)
ss.free;//очищаем строку от мусора
comandtext:=s;
comand:=s;
text:=s;
delete(text,1,4);
delete(comand,5,Length(comand));
появились ошибки.
Checking project dependencies...
Compiling Server.dproj (Debug, Win64)
dcc64 command line for "Server.dpr"
c:\program files (x86)\embarcadero\studio\20.0\bin\dcc64.exe -$O- -$W+ --no-config -M -Q -TX.exe -AGenerics.Collections=System.Generics.Collections;
Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG
-E.\Win64\Debug -I"c:\program files (x86)\embarcadero\studio\20.0\lib\Win64\debug";"c:\program files (x86)\embarcadero\studio\20.0\lib\Win64\release";
C:\Users\Arthas\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files (x86)\embarcadero\studio\20.0\Imports";
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64;"c:\program files (x86)\embarcadero\studio\20.0\include"
-LEC:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\Win64 -LNC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64 -NU.\Win64\Debug
-NSWinapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;System;Xml;Data;Datasnap;Web;Soap; -O"c:\program files
(x86)\embarcadero\studio\20.0\lib\Win64\release";C:\Users\Arthas\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
(x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64;"c:\program files
(x86)\embarcadero\studio\20.0\include" -R"c:\program files (x86)\embarcadero\studio\20.0\lib\Win64\release";
C:\Users\Arthas\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files (x86)\embarcadero\studio\20.0\Imports";
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64;"c:\program files (x86)\embarcadero\studio\20.0\include" -U"c:\program files
(x86)\embarcadero\studio\20.0\lib\Win64\debug";"c:\program files (x86)\embarcadero\studio\20.0\lib\Win64\release";
C:\Users\Arthas\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files (x86)\embarcadero\studio\20.0\Imports";
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64;"c:\program files (x86)\embarcadero\studio\20.0\include" -V -VN -VR
-NBC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\Win64 -NHC:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win64 -NO.\Win64\Debug
Server.dpr
[dcc64 Hint] yadro.pas(133): H2164 Variable 'buff' is declared but never used in 'TForm2.IdUDPServer1UDPRead'
[dcc64 Error] yadro.pas(175): E2066 Missing operator or semicolon
[dcc64 Error] yadro.pas(176): E2066 Missing operator or semicolon
[dcc64 Error] yadro.pas(176): E2014 Statement expected, but expression of type 'TButton' found
[dcc64 Fatal Error] panelupravlenia.pas(27): F2063 Could not compile used unit 'yadro.pas'