unit MC32_42p;interfaceuses
Windows, Messages;
type
TMC32_42 = class(TForm)
Bevel1: TBevel;
private
{ Private declarations }
public
{ Public declarations }
end;var
MC32_42: TMC32_42;
data1,data2:Array[0..256]of char;
hexdata1,hexdata2:Array[0..256]of char; password1:Array[0..3]of char;
password:array[0..6]of char; icdev:longint;
st:integer;
// password:pchar;
length:smallint;
offset:smallint;
implementation{$R *.DFM}
procedure TMC32_42.ListBox1Click(Sender: TObject);
beginend;end.以上代码中:1、type的作用是什么,end;是不是TYPE的结束符。
2、TMC32_42 = class(TForm)这个类的定义是到什么地方结束。
3、TYPE都有什么用法?
Windows, Messages;
type
TMC32_42 = class(TForm)
Bevel1: TBevel;
private
{ Private declarations }
public
{ Public declarations }
end;var
MC32_42: TMC32_42;
data1,data2:Array[0..256]of char;
hexdata1,hexdata2:Array[0..256]of char; password1:Array[0..3]of char;
password:array[0..6]of char; icdev:longint;
st:integer;
// password:pchar;
length:smallint;
offset:smallint;
implementation{$R *.DFM}
procedure TMC32_42.ListBox1Click(Sender: TObject);
beginend;end.以上代码中:1、type的作用是什么,end;是不是TYPE的结束符。
2、TMC32_42 = class(TForm)这个类的定义是到什么地方结束。
3、TYPE都有什么用法?
TMC32_42 = class(TForm)这个类的定义是到end; 结束的!type的作用就是 定义类型后
var 后面可以用的类型
比如定义一个数据类型,定义一个事件,定义一个类http://topic.csdn.net/u/20100811/14/b633373d-9636-47f2-b642-7e0637382a7a.html发帖了就要及时结贴!
请问这个TYPE到底是到什么地方结束。
请问这个TYPE到底是到什么地方结束。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TOnChageDir = procedure(Sender: TObject; Dir: string);
TForm3 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form3: TForm3;implementation{$R *.dfm}type
TDataItem = class end; TDataRecord = record end;procedure TForm3.Button1Click(Sender: TObject);
begin
ShowMessage('test');
end;type
TClassType = (CT_F1, CT_F2);
var
S: string;end.
type
TA = class(TObject)
end; TB = class(TObject)
end;
--------------------------- 结束
var
x: TB;type
TA = class(TObject)
end; TB = class(TObject)
end;
--------------------------- 结束
function GetID: string;
type
TA = class(TObject)
end; TB = class(TObject)
end;
--------------------------- 结束
implementation
但习惯的都写到一个type下面了 这样看起来不会很乱
2、TMC32_42 = class(TForm)这个类的定义是到end结束。
3、TYPE用法,请参考书。
2、TMC32_42 = class(TForm)这个类的定义是到什么地方结束。 //在end;结束,类的声明是class与end;匹配的
3、TYPE都有什么用法? //声明类型,声明类,声明接口等
如:
type
Tclass1 = class
end;
IInterface1 = interface
end;
TEnum1 = (em1, em2);
请参考吧,以下是我最近所提问的。。
http://topic.csdn.net/u/20100810/13/26842122-01fb-4e0e-9cc6-0f5d2bee39ec.html
http://topic.csdn.net/u/20100818/07/b2323799-ba89-4346-b7a2-372f58fe14b1.html
http://topic.csdn.net/u/20100818/07/6ba1d622-73f5-4b13-9576-c4db4b1f0692.html
http://topic.csdn.net/u/20100820/13/74edf22b-c7da-47f7-be0a-1a2dca6cc423.html
http://topic.csdn.net/u/20100821/10/91dded7c-f6f8-40de-80da-5038a311ead4.html希望对你有帮助。。 =D
2.//在end;結束,類的聲明是class與end;匹配的
3.//聲明類型,聲明類,聲明介面等
如:
type
Tclass1 = class
end;
IInterface1 = interface
end;
TEnup1 = (ep1, ep2);
2、类的定义以end;为结束标志。
3、type主要用作数据类型、类、接口等声明,比如自定义数据,其他具体用法详见语法手册
2、类的定义是以End为结束标志;
3、Type作用的主要类型有数据类型,比如记录,指针、枚举、类、接口等类型;
T2 = T1;
T3 = Integer;
T4 = T2;T1, T2, T3, T4, and Integer all denote the same type. To create distinct types, repeat the word type in the declaration. For example,type TMyInteger = type Integer;creates a new type called TMyInteger which is not identical to Integer.
Language constructions that function as type names denote a different type each time they occur. Thus the declarationstype TS1 = set of Char;
TS2 = set of Char;create two distinct types, TS1 and TS2. Similarly, the variable declarationsvar S1: string[10];
S2: string[10];create two variables of distinct types. To create variables of the same type, usevar S1, S2: string[10];ortype MyString = string[10];var
S1: MyString;
S2: MyString;
遇到别的开始,或遇到function和procedure,就自动结束了
与类里的public/private等关键词类似end是具体类型定义的结束
如果要再定义一个类,就再type就行了
类的用法多着去了
推荐看看《Delphi完美经典》
皮肤 lz 的专研精神。
我的理解是“就是这么用的”。
呵呵,莫见笑。