你可以在紧靠implimentation前面声明

解决方案 »

  1.   

    new unit 
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
        你的数据类型;
        或者函数implementationend.
    然后再你的程序中use 该单元
      

  2.   

    type
      tagTypes = record
        tag1 : integer;
        tag2 : string;
        //.....
      end;//........
    procedure doSomething();
    var myTag : tagTypes;
    begin
      with myTag do begin
           myTag.tag1 := 8888;
           myTag.tag3 := 'good luck';
      end;  //........
    end;
      

  3.   


    type 
      TMyDataType = (dtHello1, dtHello2, dtHello3);
      MyDatas: array [TMyDataType] of string = ('hello1', 'hello2', 'hello3');//访问时,MyDatas[dtHello1] ==>'hello1', ...