new unit unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type 你的数据类型; 或者函数implementationend. 然后再你的程序中use 该单元
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;
type TMyDataType = (dtHello1, dtHello2, dtHello3); MyDatas: array [TMyDataType] of string = ('hello1', 'hello2', 'hello3');//访问时,MyDatas[dtHello1] ==>'hello1', ...
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
你的数据类型;
或者函数implementationend.
然后再你的程序中use 该单元
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;
type
TMyDataType = (dtHello1, dtHello2, dtHello3);
MyDatas: array [TMyDataType] of string = ('hello1', 'hello2', 'hello3');//访问时,MyDatas[dtHello1] ==>'hello1', ...