Funcion generica
Publicado por Mauricio (17 intervenciones) el 10/04/2003 15:15:58
Hola tengo hecha un procedimiento en un formulario que me vacia los edits, combos y alguna cosilla mas. DEntro del formulario funciona perfectamente, pero quiero hacerlo generico para poder usarlo en todos los formularios.
En uses de la unit en la que la quiero declarar, q tengo q poner para que me pille bien la funcion?? ¿que parametro le paso al formulario???
Espero q me contesteis, este es el codigo fuente del procedimiento
procedure VaciarCampos();
var
i: ShortInt;
AuxComponente: TComponent;
begin
for i :=0 to ComponentCount - 1 do
begin
AuxComponente := Components[I];
if AuxComponente is TEdit then
begin
with (Auxcomponente as TEdit) do
begin
text:='';
end;
end;//if
if Auxcomponente is TDAteTImePicker then
begin
with (auxcomponente as TDAteTImePicker) do
begin
date:=now;
end;
end;//if
if Auxcomponente is TComboBox then
begin
with (auxcomponente as TComboBox) do
begin
text:='';
end;
end;//if
end; //for
end;//Procedimiento
En uses de la unit en la que la quiero declarar, q tengo q poner para que me pille bien la funcion?? ¿que parametro le paso al formulario???
Espero q me contesteis, este es el codigo fuente del procedimiento
procedure VaciarCampos();
var
i: ShortInt;
AuxComponente: TComponent;
begin
for i :=0 to ComponentCount - 1 do
begin
AuxComponente := Components[I];
if AuxComponente is TEdit then
begin
with (Auxcomponente as TEdit) do
begin
text:='';
end;
end;//if
if Auxcomponente is TDAteTImePicker then
begin
with (auxcomponente as TDAteTImePicker) do
begin
date:=now;
end;
end;//if
if Auxcomponente is TComboBox then
begin
with (auxcomponente as TComboBox) do
begin
text:='';
end;
end;//if
end; //for
end;//Procedimiento
Valora esta pregunta


0