type
TPerson = record
FirstName, LastName: string[40];
BirthDate: TDate;
case Citizen: Boolean of
True: (Birthplace: string[40]);
False: (Country: string[20];
EntryPort: string[20];
EntryDate, ExitDate: TDate);
end;procedure TForm1.Button1Click(Sender: TObject);
var p:TPerson;
begin
p.Citizen:=true;
p.Country:='aa';
showmessage(p.Country);
end;不明白这一句.是根据Citizen来决定有无Country字段吗?咋上边的还能用?
TPerson = record
FirstName, LastName: string[40];
BirthDate: TDate;
case Citizen: Boolean of
True: (Birthplace: string[40]);
False: (Country: string[20];
EntryPort: string[20];
EntryDate, ExitDate: TDate);
end;procedure TForm1.Button1Click(Sender: TObject);
var p:TPerson;
begin
p.Citizen:=true;
p.Country:='aa';
showmessage(p.Country);
end;不明白这一句.是根据Citizen来决定有无Country字段吗?咋上边的还能用?
解决方案 »
- dbgrid保存的问题!
- 请位listview中显示出来的数据能用rave以打印预览的形式显示出来吗?请各位高手进来看看。谢谢
- 求助:C/S程序使用ADO远程连接,几分钟不操作客户端程序会断开跟远程数据库的连接
- WebBrowser1.OleObject.Document.all.item('submit',0).click; 这句话,写成下面的方式为什么不对呢?请帮助看看.
- 【ListView的几个问题】请教。
- 求Delphi的讲课资料、讲义、课件、笔记、教材等都可以。
- 实现Unix与win2k夸平台之间的通信,请各路高手帮忙~~~在线等待....
- 请问哪个函数可以判断是不是星期天?
- DirectDraw与DirectShow关于overlay的问题
- TQuery可以同时插入多条记录吗?
- 关于Delphi用数组链表的问题!
- delphi中select语句变量查询
因为 Birthplace: string[40] Country: string[20];
这两字段个共用一块内存区域.你指定了country的同时,Birthplace的前20个字节(非Unicode,是Unicode是前20个word)一样.所以上述代码应该显示的是aa.