Say I had a function like
procedure TMyObject.DoSomething(text: string); begin // do something important with the text end;
When I call a method this way
DoSomething('some text', );
the code editor displays red squiggly with a comma after the last parameter, as I expected. The compiler, however, accepts this code, and everything works as if the comma were not there.
Why does this look like legal syntax? Is there some historical reason that is still supported today (I tried it in Delphi 2006 and others seem to have experienced it in 2007 too)?
source share