[fpc-devel] Re: CodeGear abandons Delphi.NET

dmitry boyarintsev skalogryz.lists at gmail.com
Thu Nov 6 14:59:45 CET 2008

WITH is also usefull to initialize records

with rec do begin
  field1 := 1;
  field2 := 2;
  field3 := 3;
  field4 := 4;
  // and so on

rather than c'sh style:

rec.field1 := 1;
rec.field2 := 2;
rec.field3 := 3;
rec.field4 := 4;

I also like to use with structure in bigger 'if' statement: with rec do if
(field1 = 0) and (field2 <> field3) or (field4 <> 0) then {...};

instead of: if (rec.field1 = 0) and (rec.field2 <> rec.field3) or
(rec.field4 <> 0) then {...};

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 :)

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20081106/038eb3a2/attachment.html>

More information about the fpc-devel mailing list