This does look kind of strange at first but all that is happening is
that the compiler sees a blank statement inside the begin..end block.
Think of it this way:


  if (assigned(loc)) then begin
    ;  // this is OK. It just gets optimized out
    // somecode
  end;

 
This will compile fine too:


  if (assigned(loc)) then begin;;;;;;;;;;
    ;;;;;;;;;;
    // somecode
  end;;;;;;;;;;



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh
Sent: Wednesday, November 02, 2005 12:49 PM
To: 'Delphi-Talk Discussion List'
Subject: strange coding

Hello,

By accident a came across a strange coding:

      if (assigned(loc)) then begin;
         // somecode
      end;

Note the ';' after the begin !

This compiles fine. Wy ? Is this a minor flaw, or has this some Pascal
history ?

---
Rgds, Wilfried
http://www.mestdagh.biz

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to