<p>WITH is also usefull to initialize records</p><p>with rec do begin<br> field1 := 1;<br> field2 := 2;<br> field3 := 3;<br> field4 := 4;<br> // and so on<br>end;<br><br></p><p>rather than c'sh style:</p><p>rec.field1 := 1;<br>
rec.field2 := 2;<br>rec.field3 := 3;<br>rec.field4 := 4;<br> <br></p><p>I also like to use with structure in bigger 'if' statement: with rec do if (field1 = 0) and (field2 <> field3) or (field4 <> 0) then {...};<br>
<br>instead of: if (rec.field1 = 0) and (rec.field2 <> rec.field3) or (rec.field4 <> 0) then {...};</p><p>though, i don't like usinng nested withs, or with for multiple records (with rec1, rec2 do). It can make like easier, but it can also bring some bug in the code :)<br>
</p><p>Anyway. All libs are written, using old-style syntax. So is it realyl necessary, to add these new syntax changes to FPC? may be it's better to clean then bugs first, and start changing syntax after that? Besides, these changes are designed for .NET IDE, the code that would use new delphi syntax would not be used with FPC, anyway.</p>
<br>