21
Generale / Re:parametri passati per riferimento
« Ultimo post da DragoRosso il Maggio 16, 2024, 04:58:28 pm »Prova così:
Codice: [Seleziona]
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure Cancella(elenco: array of string);
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
var prova: array of string;
{ TForm1 }
procedure TForm1.Cancella(elenco: array of string);
var ID: string;
begin
for ID in elenco do
begin
///CANCELLA IL RECORD QUI
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SetLength(prova, 10);
///RIEMPI L'ARRAY
///.............
//Cchiama la canecllazione
Cancella(prova);
///ELIMINA l'ARRAY
SetLength(prova, 0);
end;
end.