본문 바로가기

Delphi

(Delphi) 델파이 사용 예제

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
procedure test2(text: string);
function test3: string;
function test170324: string;
public
procedure test;
var
i : Integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.test3: string;
begin
Result := 'ddd';
end;
function TForm1.test170324: string;
begin
Result := 'test170324';
end;
procedure TForm1.test;
begin
ShowMessage('testtest');
end;
procedure TForm1.test2(text : string);
begin
ShowMessage(text);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// if 1 = 1 then begin //true
if 1 <> 1 then begin //false
ShowMessage('맞아요');
end else begin
ShowMessage('틀려요');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i : Integer;
s : String;
begin // 순차적으로 실행
i := 0;
// while i < 10 do begin
while i < do begin
ShowMessage(IntToStr(i));
i := i + 1;
if i = 3 then break;
end;
s := 'test';
ShowMessage(s);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
i : integer;
begin
for i := 5 downto 0 do begin
ShowMessage(IntToStr(i)); // 543210 6번 실행
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
test;
test2('qkqh');
test2(test3);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
test2(test170324);
end;
end.


'Delphi' 카테고리의 다른 글

(Delphi) 델파이 증감연산자  (0) 2017.04.02