求最好的变量定义!我想这么定义的?觉得不好,你有更好的吗?(100分)

  • 主题发起人 主题发起人 youou
  • 开始时间 开始时间
Y

youou

Unregistered / Unconfirmed
GUEST, unregistred user!
在D6中:
共有9个项目需要测试,可以根据需要选择是否要测试其中的哪一项:
第1项需要3种数据:
X,Y:integer;
DY:single;
第2,3项需要2种数据:
X,Y:integer;
第4..9项需要1种数据:
DY:single;

其中根据不同的客户有两种不一样的数据量:
客户1:
1,2,3项目分别有6条数据,4..9项目分别有1条数据.
客户2:
1,2,3项目分别有1条数据,4..9项目分别有1条数据.

在数据库中根据客户不同有两个表,这些都是一条记录.!

type
TBuWu=record
x,y:integer;
Bu:single;
end;
TData = record
case ProjType:integer of
1:(BuWu:TBuWu);
2,3:(x,y:integer);
4,5,6,7,8,9:(DY:single);
end;
这样好像不好吧?
 
type
TBuWu=record
x,y:integer;
Bu:single;
end;
TMyBuWU=array of TBuWu;

Txy=record
x,y:integer;
end;
TMyXY=array of Txy;

TData = record
case ProjType:integer of
1:(BuWu:TMyBuWu);
2,3:(data:TMyXY);
4,5,6,7,8,9:(DY:single);
end;
这样好像不好吧?
关于这样的记录的用法有点不在明白?
访问时需要指定ProjType 的值吗?
进来的就帮忙都UP一下吧!TKS


 
看不懂,听课
 
TR = record
X,Y:integer;
DY:single;
end;
这样有什么不好?
 
我觉得你们的想法比较乱。:)
是不是用C++用多了?
 
后退
顶部