
23.06.2011, 18:35
|
Прохожий
|
|
Регистрация: 23.06.2011
Сообщения: 7
Репутация: 10
|
|
Передача записи как параметра в процедуру
Добрый день всем. Прошу помощи со следующим:
Код:
unit Control;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
CommandType = record {Тип команда}
Address: byte;
Checksum: byte;
Comm1,Comm2: byte;
NData: byte;
Data1, Data2, Data3, Data4, Data5, Data6: byte;
end;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Button3: TButton;
Button4: TButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Label9: TLabel;
GroupBox3: TGroupBox;
Button5: TButton;
{ procedure Button1Click(Sender: TObject);}
procedure StartMove(Sender: TObject);
{ procedure SendSettings(Sender: TObject);}
procedure Send(Sender: TObject; CommandData: CommandType);
private
{ Private declarations }
public
{ Public declarations }
end;
const
Update: CommandType = (Address:0; Checksum:0; Comm1:0; Comm2:$1A; NData:0; Data1:0; Data2:0; Data3:0; Data4:0; Data5:0; Data6:0);
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Send(Sender: TObject; CommandData: CommandType);
begin
Close;
end;
procedure TForm1.StartMove(Sender: TObject);
begin
Send(Sender, Update); :confused:
end;
{procedure TForm1.Button1Click(Sender: TObject);
begin
SendSettings(Sender);
end;}
end.
Админ: Учимся пользоваться тегами по назначению!
Вылезает ошибка
Incompatible types: 'CommandType' and 'procedure, untyped pointer or untyped parameter'
с указанием на строку, где стоит 
|