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都有什么用法?

解决方案 »

  1.   

    Type 语句创建用户定义的类型,end不是它的结束符,它后面是跟分号结尾的语句
      TMC32_42 = class(TForm)这个类的定义是到end; 结束的!type的作用就是 定义类型后
    var 后面可以用的类型
    比如定义一个数据类型,定义一个事件,定义一个类http://topic.csdn.net/u/20100811/14/b633373d-9636-47f2-b642-7e0637382a7a.html发帖了就要及时结贴!
      

  2.   


    请问这个TYPE到底是到什么地方结束。
      

  3.   

    上一贴的4L的回复!直到其它声明出现,例如全局变量、公共函数等,或者implementationtype后面只要跟上符合的分句就行了,直到其他关键字出现!在type和其他关键字之间仍可以继续定义类型
      

  4.   


    请问这个TYPE到底是到什么地方结束
      

  5.   

    我在另一个帖子里面已经回复过了... “直到其它声明出现,例如全局变量、公共函数等,或者implementation”如果还不明白的话请自行翻书,或者动手写写就知道了。
      

  6.   

    unit Unit3;interfaceuses
      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.
      

  7.   


    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
      

  8.   

    TOnChageDir = procedure(Sender: TObject; Dir: string) of object;其实只要有这个关键字 ,它下面就可以直接定义,是一条分句即可!
    但习惯的都写到一个type下面了 这样看起来不会很乱
      

  9.   

    任何一本讲DELPHI语法的书上都会讲,就是类型声明
      

  10.   

    delphi5开发人员指南,你找一本看看
      

  11.   

    1、type的作用是定义类的起始语句,end是TYPE的结束符。
    2、TMC32_42 = class(TForm)这个类的定义是到end结束。
    3、TYPE用法,请参考书。
      

  12.   

    1、type的作用是什么,end;是不是TYPE的结束符。//类型声明符,类似于var,这不过他是声明类型的,与end无关
    2、TMC32_42 = class(TForm)这个类的定义是到什么地方结束。 //在end;结束,类的声明是class与end;匹配的
    3、TYPE都有什么用法? //声明类型,声明类,声明接口等
    如:
    type
      Tclass1 = class
      end;
      IInterface1 = interface
      end;
      TEnum1 = (em1, em2);
      

  13.   

    type 的作用跟var、const类似,不需要end来结尾
      

  14.   

    我问过这样的问题。。
    请参考吧,以下是我最近所提问的。。
    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
      

  15.   

    1.//型別宣告符,類似於var,這不過他是聲明類型的,與end無關
    2.//在end;結束,類的聲明是class與end;匹配的
    3.//聲明類型,聲明類,聲明介面等
    如:
    type
      Tclass1 = class
      end;
      IInterface1 = interface
      end;
      TEnup1 = (ep1, ep2);
      

  16.   

    1、type是关键字,这里用作类型定义,end不是其结束标志。
    2、类的定义以end;为结束标志。
    3、type主要用作数据类型、类、接口等声明,比如自定义数据,其他具体用法详见语法手册
      

  17.   

    1、Type是定义类型的关键字,end不是其结束标志,因为可以连续定义几个类型的。
    2、类的定义是以End为结束标志;
    3、Type作用的主要类型有数据类型,比如记录,指针、枚举、类、接口等类型;
      

  18.   

    Type 语句创建用户定义的类型 用来定义类型的啊!建议你看一下PASCAL语言基础
      

  19.   

    Type identity is almost straightforward. When one type identifier is declared using another type identifier, without qualification, they denote the same type. Thus, given the declarationstype  T1 = Integer;
      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;
      

  20.   

    type与var一样,是一组定义的开始,是开始定义类型还是开始定义变量
    遇到别的开始,或遇到function和procedure,就自动结束了
    与类里的public/private等关键词类似end是具体类型定义的结束
      

  21.   

    type  是 定义一个类,type后面的第一个end是结束
    如果要再定义一个类,就再type就行了
    类的用法多着去了
    推荐看看《Delphi完美经典》
      

  22.   

    O(∩_∩)O~
    皮肤 lz 的专研精神。
    我的理解是“就是这么用的”。
    呵呵,莫见笑。