Z Zyee Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #3 以下record定义为什么编译未能通过: type rec= record Int1 :integer; case Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); Int2 :Integer; end;
以下record定义为什么编译未能通过: type rec= record Int1 :integer; case Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); Int2 :Integer; end;
S Schiesser Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #5 应为: type rec= record Int1 :integer; case <font color="red">YourInt: </font>Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); Int2 :Integer; end;
应为: type rec= record Int1 :integer; case <font color="red">YourInt: </font>Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); Int2 :Integer; end;
S Schiesser Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #6 再来一个例子: (From Delphi Help)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;
再来一个例子: (From Delphi Help)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;
S SuperMMX Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #8 怎么一样呀, //agree Schiesser
蚯 蚯蚓 Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #9 对个<B>P</P> 错误在于: record的变体部分大小不定, 因此必须在记录的最末尾, 否则后续的域难以定位, 也就是说,应该改为: rec= record Int1 :integer; <font color=red>Int2 :Integer;</font> case Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); end; 另外 1、case tag: ordinalType of中的tag不一定需要, 后果是将来使用变体记录时就不能引用这个tag了 2、由于“变体部分必须在记录的最末尾” 所以这里的case不需要end~~~
对个<B>P</P> 错误在于: record的变体部分大小不定, 因此必须在记录的最末尾, 否则后续的域难以定位, 也就是说,应该改为: rec= record Int1 :integer; <font color=red>Int2 :Integer;</font> case Integer of 1 : (str1 :array[1..8] of char); 2 : (str2 :array[1..4] of char); end; 另外 1、case tag: ordinalType of中的tag不一定需要, 后果是将来使用变体记录时就不能引用这个tag了 2、由于“变体部分必须在记录的最末尾” 所以这里的case不需要end~~~
Z Zyee Unregistered / Unconfirmed GUEST, unregistred user! 1999-12-16 #12 I feel very happy that I have receied so much help from you. thanks . email Addr: zhangjifeng@sheca.com
I feel very happy that I have receied so much help from you. thanks . email Addr: zhangjifeng@sheca.com