jueves, 29 de mayo de 2014

delphi funcion pasar por valor

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
function porvalor(var dato: string):bool;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

//************************************
procedure TForm1.Button1Click(Sender: TObject);
var
a: string;
begin

porvalor(a);
ShowMessage(a);

end;


//************************************
function TForm1.porvalor(var dato: string):bool;
begin

dato:='hola';

end;


end.

No hay comentarios: