哪位富哥给一个类似于c++中结构数组的pascal 记录的例子,包括定义和使用。谢谢!(200分)

  • 主题发起人 主题发起人 delphi6
  • 开始时间 开始时间
D

delphi6

Unregistered / Unconfirmed
GUEST, unregistred user!
哪位富哥给一个类似于c++中结构数组的pascal 记录的例子,包括定义和使用。谢谢!
 
大家都不会吗??
 
type

TPoint = record
X, Y: Single;
end;
TVector = array[0..1] of TPoint;
TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
TDate = record
D: 1..31;
M: TMonth;
Y: 1900..1999;
end;

这方面Pascal比C++强多了!
 
type

TPoint = record
X, Y: Single;
end;
TVector = array[0..1] of TPoint;
TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
TDate = record
D: 1..31;
M: TMonth;
Y: 1900..1999;
end;

这方面Pascal比C++强多了!
 
定义:
type Prec=^myrecord;
type myrecord=record
i:integer;
j:string;
next:myrecord;
end;

使用:
var:rec:myrecord;
begin
prec:=@rec;
prec^.i:=9;
prec^.j:='myrecord';
end;
 
type
Elemtype=record
goodscode:string[6];
goodsname:string[11];
minUnitonware:integer;
curUnitonware:integer;
end;
linearlist=record
element:array [0..99] of elemtype;
count:integer

end;
 
type
Elemtype=record
goodscode:string[6];
goodsname:string[11];
minUnitonware:integer;
curUnitonware:integer;
end;
linearlist=record
element:array [0..99] of elemtype;
count:integer

end;
 
后退
顶部