As you know, WITH keyword seems to be doomed as it's tagged as dangerous. The proposal is something like this:Code: Pascal [Select]with TForm2.Create(nil) dotry AppLogger.LogForm(with); with.ShowModalfinally with.Freeend;
This would be similar as casting with "as" but with creating a variable on the fly.(But again... that's not how Pascal works)
The only possible form I would see is with the "as"-keyword.Code: Pascal [Select]with TForm2.Create(nil) as myform dotry AppLogger.LogForm(myform); myform.ShowModalfinally myform.Freeend;
I don't like it since it breaks the predeclaration of variables of Pascal.
try ..except on e: exception do ...end;
for (var i=0...)