On Thu, Jul 17, 2008 at 9:09 AM, Jonas Maebe <[EMAIL PROTECTED]> wrote:
> Or
>
> with FDayList[itm.WeekDayNum].Rows[itm.Timeslot] do
>  AvailableSlots:= AvailableSlots+itm.CountSlots;


No that's one language construct I wish Object Pascal could do
without!  I personally hate the 'with' statement, and it's hard to
debug.

At least FPC with mode objfpc had the common sense NOT to allow the
following (which I believe is still allowed in Delphi).  Also tooltip
evaluation/debugging doesn't work with 'with' statements in Lazarus or
Delphi.


type
  MyClass = class(TObject)
  ...
  public
    property MyName: String .....
  end;

procedure MyClass.Foobar;
var
  MyName: string;
begin
  with self do
  begin
     MyName := 'hello';  // Are we using e local var MyName or MyClass.MyName??
  end;
end;



Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to