-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit6.pas
66 lines (52 loc) · 1.32 KB
/
Unit6.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sEdit, sButton, sLabel;
type
TForm6 = class(TForm)
sLabelFX1: TsLabelFX;
sButton1: TsButton;
sEdit1: TsEdit;
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure sButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
cClose: boolean=false;
implementation
uses Unit2,muuttujat,proseduurit;
{$R *.dfm}
procedure TForm6.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
canclose:=cClose;
end;
procedure TForm6.sButton1Click(Sender: TObject);
type
TEmailToimitus = record
mtype: word;
mtype2: word;
ra: word;
email: string[50];
end;
var
EmailToimitus: TEmailToimitus;
begin
if please_wait_arvo=true then exit;
if form6.sEdit1.text='' then exit;
if ValidEmail(form6.sEdit1.text)=false then begin
showmessage('Invalid email');
exit;
end;
please_wait(true);
EmailToimitus.mtype:=241;
EmailToimitus.mtype2:=241;
EmailToimitus.ra:=random(55000)+1;
EmailToimitus.email:=sedit1.text;
TCPClient2.WriteBuffer(@EmailToimitus,sizeof(EmailToimitus));
end;
end.