Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#6

AW: ParamStr komplette Verzeichnisse auswählen

  Alt 22. Okt 2015, 10:29
ts, ts, ts, ...
Delphi-Quellcode:
procedure dofoo;
var
  foo: TFoo;
begin
  foo := TFoo.Create;
  try

    // work with foo

  finally
    foo.Free;
  end;
end;

// aber

procedure dofoobar;
var
  foo: TFoo;
  bar: TBar;
begin
  // lokale Variablen sind NICHT initialisiert,
  // also machen wir das mal
  foo := nil;
  bar := nil;
  try
    foo := TFoo.Create;
    bar := TBar.Create;
    
    // work with foo and bar

  finally
    foo.Free;
    bar.Free;
  end;
end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat