<div>Is contructions like this that aren't available:</div><div> </div><div>type<br> TRec = record<br> Numero: Integer;<br> Nome: String;<br> end;</div><div> </div><div>implementation</div><div> </div><div>{$R *.lfm}</div>
<div> </div><div>procedure ShowTRec(rec: TRec);<br>begin<br> ShowMessage(rec.Nome);<br>end;</div><div> </div><div>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> ShowTRec((Numero: 1; Nome: 'Pascal'));<br>
end;</div><div> </div><div>In this constructions is that today is nice to use a function to create the TRec.</div><div> </div><div class="gmail_quote">2012/2/24 Everton Vieira <span dir="ltr"><<a href="mailto:tonvieira@gmail.com">tonvieira@gmail.com</a>></span><br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div>I was trying to make this construction:</div><div> </div>
<div>type<br> TRec = record<br> Numero: Integer;<br> Nome: String;<br> end;</div><div> </div><div>function mTRec(Numero: Integer; Nome: String): TRec;</div>
<div> </div><div>type<br> TTest = class<br> const Nomes: array[0..2] of TRec = (mTRec(1, 'everton'), mTRec(2, 'murilo'), mTRec(3, 'vieira'));<br> end;</div><div><br>implementation</div><div> </div>
<div>{$R *.lfm}</div><div> </div><div>function mTRec(Numero: Integer; Nome: String): TRec;<br>begin<br> Result.Numero := Numero;<br> Result.Nome := Nome;<br>end;</div><div> </div><div>{ TForm1 }</div><div> </div><div>procedure TForm1.Button1Click(Sender: TObject);<br>
var<br> i1: Integer;<br>begin<br> for i1 := 0 to Length(TTest.Nome) -1 do<br> ShowMessage(TTest.Nomes[i1].Nome);<br>end; </div><div> </div><div>Is there any how to do it?</div><span class="HOEnZb"><font color="#888888"><div>
<br>-- <br>Everton Vieira.<br>
</div>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Everton Vieira.<br>