<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-04-21 8:00 GMT+02:00 <span dir="ltr"><<a href="mailto:kevin@kdx.me" target="_blank">kevin@kdx.me</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">type<br>
maritalStates = (single, married, widowed, divorced);<br>
<br>
TPerson = record<br>
name: record<br>
first, middle, last: string;<br>
end;<br>
sex: (male, female);<br>
dob: TDateTime;<br>
case maritalStatus: maritalStates of<br>
single: ( );<br>
married, widowed: (marriageDate: TDateTime);<br>
divorced: (marriageDate, divorceDate: TDateTime;<br>
isFirstDivorce: boolean)<br>
end;<br>
<br>So the question then becomes: is the wiki in error, or is there something I'm missing? Furthermore, if the wiki is in fact wrong, and this is a limitation, is there any inherent reason why? It seems to me like this should be possible, it's certainly a very useful thing to have.<br></blockquote><div><br></div><div>That is 100% bad example. You can't have two fields with the same name even for that kind of record with "case" part. Correct example:</div></div><div class="gmail_extra"><br></div><div class="gmail_extra">=== begin code ===</div><div class="gmail_extra">type</div><div class="gmail_extra"> TMaritalStates = (single, married, widowed, divorced);</div><div class="gmail_extra"><br></div><div class="gmail_extra"> TPerson = record</div><div class="gmail_extra"> name: record</div><div class="gmail_extra"> first, middle, last: string;</div><div class="gmail_extra"> end;</div><div class="gmail_extra"> sex: (male, female);</div><div class="gmail_extra"> dob: TDateTime;</div><div class="gmail_extra"> case maritalStatus: TMaritalStates of</div><div class="gmail_extra"> single: ();</div><div class="gmail_extra"> married,widowed,divorced: (</div><div class="gmail_extra"> marriageDate: TDateTime;</div><div class="gmail_extra"> case TMaritalStates of</div><div class="gmail_extra"> widowed: (</div><div class="gmail_extra"> widowedDate: TDateTime);</div><div class="gmail_extra"> divorced: (</div><div class="gmail_extra"> divorceDate: TDateTime;</div><div class="gmail_extra"> isFirstDivorce: boolean)</div><div class="gmail_extra"> );</div><div class="gmail_extra"> end; </div></div><div class="gmail_extra"><span style="font-size:12.8px">=== end code ===</span><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>