Default Parameters expressions



Default Parameters expressions
Smart pascal source code
procedure Test1(a: Float = 1); begin WriteLn(a); end; procedure Test2(a: Integer = 1 + 1); begin WriteLn(a); end; procedure Test3(a: Float = StrToInt('123')); begin WriteLn(a); end; { main.pas } procedure TApplication.RunApp; Begin Test1; Test2; Test3; Test1(10.5); Test1(10); Test1(11.5); { <<<<<<<<<<<< CONSOLE OUTPUTS >>>>>>>>>>>>>>>>>>> 1 2 123 10.5 10 11.5 }