Autor Beitrag
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 26.11.04 23:11 
Hallo Leute!

Ich hab mal ne ganz dolle Frage, die unter die Kategorie "Newbe" fallen würde:

Wenn ich eine Funktion definiere, z.B:

ausblenden Delphi-Quelltext
1:
  function MacheDies(Var1: Integer; Ver2: String; IgnoreError: Boolean);					


wie kann ich dann den dritten Parameter als optinal deklarieren, ohne allerdiengs die Funktion als overlaod zu deklarieren?

Danke!

Alstar
Benutzername
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 210

Win XP Pro
Delphi 7 PE, D2005 Prof. SSL
BeitragVerfasst: Fr 26.11.04 23:20 
Du könntest ihr einen Default-Wert zuweisen, der genommen wird, wenn der Parameter weggelassen wird.
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Fr 26.11.04 23:25 
z.B. so:
ausblenden Delphi-Quelltext
1:
function MyFunction(ValueA: Integer; ValueB: Integer = 10): Integer;					

_________________
Ciao, Sprint.