тип записи один, а поля разные:
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | type
TFruit = record
Name: String ;
Color: TColor;
Figure: Integer ;
case Integer of
0 : (
Weight: Integer ;
More: String [ 10 ];
Words: array [ 0..1 ] of Word ;
);
1 : (
Size: Integer ;
Next: String [ 10 ];
Bytes: array [ 0..3 ] of Byte ;
);
end ;
...
var
f: TFruit;
begin
f . Weight:= 123 ;
f . More:= 'abc' ;
ShowMessage(IntToStr(f . Weight));;
ShowMessage(f . More);
f . Size:= 456 ;
f . Next:= 'xyz' ;
ShowMessage(IntToStr(f . Weight));;
ShowMessage(f . More);
end ;
|
__________________
Пишу программы за еду.
__________________
|