Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TPar = record
temperatura : double;
humedad : double;
end;
procedure Proceso( T: array of TPar);
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function Par(t, h : double) : TPar;
begin
result.temperatura := t;
result.humedad := h;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
t : TPar;
begin
t.temperatura := 50;
t.humedad := 0;
proceso([Par(20,78), Par(30,40),t]);
end;
procedure Proceso( T: array of TPar);
var
i : integer;
begin
for i := 0 to length(T) - 1 do
begin
SHowmessage(FormatFloat('0.00',T[i].temperatura) + ' ' + FormatFloat('0.00',T[i].humedad));
end;
end;
otra...esta es analoga a como trabaja TPoint.