Title: Message
> IMHO, I'd consider the use of begin..ends essential in any Delphi Coding Standard doco. ;-)
Why make it more complex than it needs to be?
 
if Enabled then a := 1 else a := 2;

Compare that to:
 
if Enabled then begin
  a:=1;
end
else begin
  a:=2;
end;
I would imagine this generates more code and would be slower.  In my opinion, begin/end blocks are designed for when more than one statement is required.
 
Regards,

Ross Levis
=====================================
StationPlaylist.com
http://www.stationplaylist.com
Low-cost music scheduling, live assist & automation software for
radio broadcasting, internet streaming, & in-store music systems.
Discussion Group: http://groups.yahoo.com/group/StationPlaylist
=====================================

From: Ross Levis [mailto:[EMAIL PROTECTED]
 
Hi Stacey

Aha.  Application.CreateForm needs a semi-colon at the end otherwise it says "Call to Application.CreateForm is missing or incorrect.  So a simple begin/end block fixes the problem and it now works.

Thanks.
----- Original Message -----
From: Stacey Verner

D6, New Project, New Form, Project -> View Source and modify so it is as below and it all seems to work fine.

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

begin
  Application.Initialize;
  if ParamStr(1) = '1' then begin
    Application.CreateForm(TForm1, Form1);
  end
  else begin
    Application.CreateForm(TForm2, Form2);
  end;
  Application.Run;
end.


Stacey

Stacey Verner             Ph:   +64-9-4154790
Software Developer        Fax:  +64-9-4154791
                          DDI:  +64-9-4154797
CJN Technologies Ltd.     Email: [EMAIL PROTECTED]
PO Box 302-278, North Harbour, Auckland 1330, New Zealand
12 Piermark Drive, North Harbour, Auckland, New Zealand
Visit our website at http://www.cjntech.co.nz/

Stacey Verner             Ph:   +64-9-4154790
Software Developer        Fax:  +64-9-4154791
                          DDI:  +64-9-4154797
CJN Technologies Ltd.     Email: [EMAIL PROTECTED]
PO Box 302-278, North Harbour, Auckland 1330, New Zealand
12 Piermark Drive, North Harbour, Auckland, New Zealand
Visit our website at http://www.cjntech.co.nz/




_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi




_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to