1.退出函数(过程)的语名。Exit;
procedrue TEST;
begin
.....My procedrue......
if ... then Exit;
end;
2.//数组可以
var Test1:array[0..1] of char;
Test2:array[0..1] of char;
begin
Fillchar(Test1,sizeof(Test1),$20);
Fillchar(Test2,sizeof(Test2),$20);
Test1[0]:='A';
Test2[1]:='B';
Move(Test2,Test1,SizeOf(Test2));
//结构可以
type
TMyTest=record
Test1:string;
Test2:string;
end;
var MyTest1:TMyTest;
MyTest2:TMyTest;
begin
MyTest1.Test1:='My String 1';
MyTest1.Test2:='My Stirng 2';
MyTest2:=MyTest1;
ShowMessage(MyTest2.Test2);
//对象可以
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Button2:=Button1;
end;
3.Windows中的API在windows.pas中,在程序中象一般的函数(过程)那样使用。
MessageBoX(Handle,'MessageBox Show','MyMessageBox',MB_OK);
其它DLL当然要自已动手导出,例子可以照windows.pas。
procedrue TEST;
begin
.....My procedrue......
if ... then Exit;
end;
2.//数组可以
var Test1:array[0..1] of char;
Test2:array[0..1] of char;
begin
Fillchar(Test1,sizeof(Test1),$20);
Fillchar(Test2,sizeof(Test2),$20);
Test1[0]:='A';
Test2[1]:='B';
Move(Test2,Test1,SizeOf(Test2));
//结构可以
type
TMyTest=record
Test1:string;
Test2:string;
end;
var MyTest1:TMyTest;
MyTest2:TMyTest;
begin
MyTest1.Test1:='My String 1';
MyTest1.Test2:='My Stirng 2';
MyTest2:=MyTest1;
ShowMessage(MyTest2.Test2);
//对象可以
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Button2:=Button1;
end;
3.Windows中的API在windows.pas中,在程序中象一般的函数(过程)那样使用。
MessageBoX(Handle,'MessageBox Show','MyMessageBox',MB_OK);
其它DLL当然要自已动手导出,例子可以照windows.pas。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货