<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
John,<br>
<br>
I find this rather tedious and almost never use this method. I either
declare each field as an array on its own so that I dont have to
specify the field name. Or, I populate the array at run time by
calling a procedure with all the field values. You could also read it
from a file, from the database or a resource.<br>
<br>
<blockquote cite="mid00a101c744ec$d0a826c0$0100a8c0@Puffin" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">I am interested particularly in an uninitialised field in a constant
</pre>
</blockquote>
<pre wrap=""><!---->record
</pre>
<blockquote type="cite">
<pre wrap="">like:
type
TSampleRecord = record
SampCode: Integer;
SampName:string[30];
SampAddress1:array[1..3] of string[20];
iValue: integer;
end;
const
ConstArr: array [0..5] of TSampleRecord =(
(SampCode: 0; SampName:'Nought';
SampAddress1:('A01','A02','A03');iValue: 10),
(SampCode: 1; SampName:'First';
</pre>
</blockquote>
<pre wrap=""><!---->SampAddress1:('A11','A12','A13');iValue:
</pre>
<blockquote type="cite">
<pre wrap="">11),
(SampCode: 2; SampName:'Second';
SampAddress1:('A21','A22','A23');iValue: 12),
(SampCode: 3; SampName:'Third';
</pre>
</blockquote>
<pre wrap=""><!---->SampAddress1:('A31','A32','A33');iValue:
</pre>
<blockquote type="cite">
<pre wrap="">13),
(SampCode: 4; SampName:'Fourth';
SampAddress1:('A41','A42','A43');iValue: 14),
(SampCode: 5; SampName:'Five missing iValue';
SampAddress1:('A51','A52','A53'))
);
In this case the uninitialised ConstArr[5].iValue behaves as being 0,
</pre>
</blockquote>
<pre wrap=""><!---->which
</pre>
<blockquote type="cite">
<pre wrap="">is nice. I am setting up some constant records like this and it would be
convenient if I do not have to explicitly initialise every last field
</pre>
</blockquote>
<pre wrap=""><!---->value
</pre>
<blockquote type="cite">
<pre wrap="">especially if I know I won't be using that particular one...what is "best
practice"?
John
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
Delphi mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a>
<a class="moz-txt-link-freetext" href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<title>Signature</title>
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2900.2802" name="GENERATOR">
<div align="left">
<div align="left"><strong><font size="2"><font color="#666666"
face="Verdana">Rohit Gupta</font></font></strong></div>
<div align="left"><strong><font size="2"><font color="#666666"
face="Verdana">
B.E. Elec. M.E. Mem IEEE
Associate IEE</font></font></strong></div>
<div align="left"><strong><font size="2"><font color="#666666"
face="Verdana">Technical Manager</font></font></strong></div>
<div align="left"><strong><font color="#666666" face="Verdana" size="2">Computer
Fanatics Limited</font></strong></div>
<div align="left"><strong></strong> </div>
<div align="left"><font color="#666666" face="Verdana" size="2"><strong>Tel</strong>
+64 9 4892280</font></div>
<div align="left"><font color="#666666" face="Verdana" size="2"><strong>Fax</strong>
+64 9 4892290</font></div>
<div align="left"><font color="#666666"><font face="Verdana" size="2"><strong>Email
</strong></font><a href="mailto:rohit@cfl.co.nz"><font color="#0080ff"
face="Verdana" size="2">rohit@cfl.co.nz</font></a></font><font
color="#666666"><font face="Verdana" size="2"><strong></strong></font></font></div>
<div align="left"><font color="#666666"><font face="Verdana" size="2"><strong>Web
</strong></font><a href="http://www.cfl.co.nz/"><font color="#0080ff"
face="Verdana" size="2">www.cfl.co.nz</font></a></font></div>
<div> </div>
<div>
<hr></div>
<div align="left"><span
style="font-size: 7.5pt; color: rgb(153, 153, 153); font-family: Verdana;"><font
size="1"><span style="font-size: 10pt; font-family: 'Courier New';"
lang="EN-NZ"><font color="#000000"><font color="#808080" face="Verdana"
size="1">This email and any attachments contain information, which is
confidential and may be subject to legal privilege and copyright. If
you are not the intended recipient, you must not use, distribute or
copy this email or attachments. If you have received this in error,
please notify us immediately by return email and then delete this email
and any attachments.</font> <o:p></o:p></font></span></font></span></div>
</div>
</div>
</body>
</html>