.NET
•  Greatis •  Security •  AppDatabase •  Utilities •  Delphi/CB • Visual Basic •  just4fun
.NET Software
.NET Components for Visual Studio .NET, Delphi 8, Delphi 2005 and Delphi 2006
 .NET     Entire site
More Info
Delphi to C#
Index

.NET
Form Designer .NET

See also
Delphi VCL software
Visual Basic 6 software
Hot Offer

Form Desigber .Net

Delphi to C#
Language
if statement

  Delphi  

       There are two forms of if statement:
// if...then
if x<>0 then // do something
// if...then...else
if x=0 then // do something
else // do something another
begin end pair can be used:
if x=0 then
begin
  // do something
end
else
begin
  // do something another
end;
; cannot be placed before else:
if A>B then AProc; < illegal!
else BProc
if statements can be nested:
if S='Greatis Software' then GoToLink('http://www.greatis.com')
else
  if S='Microsoft' then GoToLink('http://www.microsoft.com')
  else GoToLink('http://www.google.com');
 
 
  C#

C# has very similar if statement:
// if...then
if (x<>0) then // do something
// if...then...else
if (x=0) then ;// do something
else // do something another
Complex operators can be used with "{}":
if (x=0) then
{
  // do something
}
else
{
  // do something another
}
And if can be nested too:
if (S="Greatis Software") then GoToLink("http://www.greatis.com");
else
  if (S="Microsoft") then GoToLink("http://www.microsoft.com");
  else GoToLink("http://www.google.com");

Lost features     
Added features
Warnings Place condition into parentheses and do not place ";" before else.
Additional information

 
 


Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2009 Greatis Software

eXTReMe Tracker