Forum: Object-Pascal / Delphi-Language
Delphi
by bernau,
11. Okt 2020
Warum nur mit Boolean als Result?
Forum: Object-Pascal / Delphi-Language
Delphi
by bernau,
11. Okt 2020
In vielen Fällen spricht erst mal ja nichts dagegen, aus einer Procedure eine Function zu machen.
Das Result := False; kann man nach hinten verschieben.
Function LeseJPGEin(DatnameMV:string):Boolean;
begin
If not DateiVorhanden
then exit(False);
If not HeaderOK
then exit(False);
Forum: Object-Pascal / Delphi-Language
Delphi
by bernau,
10. Okt 2020
Grade das ist doch prädistiniert für ein Exit;
if not KlapptDas1 then
Exit;
if not KlapptDas2 then
Exit;
if not KlapptDas3 then
Exit;
if not KlapptDas4 then