<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>You could use a variants instead of records, an enumeration list could keep track of the "field names".</span></div><div><span>Your user clause has to include variants. Here is part of a procedure I used for another purpose:</span></div><div><span></span> </div><div><span>var aRecord : variant;<br> i : integer;<br>begin </span></div><div>for i := 0 to Dataset.FieldCount-1 do<br> aRecord[i]:= Dataset.Fields[i].Value;</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style:
normal; background-color: transparent;">A. G.</div><blockquote style="padding-left: 5px; margin-top: 5px; margin-left: 5px; border-left-color: rgb(16, 16, 255); border-left-width: 2px; border-left-style: solid;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); height: 0px; line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div> <b><span style="font-weight: bold;">From:</span></b> Johann Spies <johann.spies@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Lazarus mailing list <lazarus@lists.lazarus.freepascal.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, February 14, 2013 3:00 AM<br> <b><span style="font-weight:
bold;">Subject:</span></b> [Lazarus] Getting a Field list of a record<br> </font> </div> <br>
<meta content="off" http-equiv="x-dns-prefetch-control"><div id="yiv533621844">I see TDataset has a method to get a list of fields. Is there something similar for type: record? <br><br>Say for instance I want to check which fields of a record are empty, how can I do it without having to specify each field manually?<br>
<br>Another example: If I want to compare two records of the same type to determine which fields differ. How do I do it and get only a list of the fields involved?<br>
<br>Regards<br>Johann<br clear="all"><br>-- <br>Because experiencing your loyal love is better than life itself, <br>my lips will praise you. (Psalm 63:3)<br>
</div><meta content="on" http-equiv="x-dns-prefetch-control"><br>--<br>_______________________________________________<br>Lazarus mailing list<br><a href="mailto:Lazarus@lists.lazarus.freepascal.org" ymailto="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br><a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br><br><br> </div> </div> </blockquote> </div></body></html>