Hi,
I've tried Eike's example with DEC Pascal (no errors) and looked at the ref. manual. This notes that a variant must be the last component of the record (which it is). It also makes sense as the allocated memory can then be set to the biggest variant. There is also a run-time diagnostic (%PAS-F-REFINAVAR) which should pick up any attempt to read from or write to an inactive record variant. However, it is clear that this isn't happening - it should. GPC should as well.
Experimenting with the data, I find that they do share memory - as soon as Width is assigned, Radius takes this value (if the types match). If Radius is a real, the value becomes scrambled.
Run-time checking should be available, as the only benefit of variants is to either save memory or pick-up on erroneous data combinations. However, just like array bounds checking, it may be an undesirable overhead for which there should be appropriate compiler options.
Dave Wood.
The Information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful.