.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  

       Variables must be defined before using in special var blocks:
var
  i: Integer;
  d: Double;
This block can be both global defined the unit's interface or implementation part and local declared within the function or procedure:
procedure Dummy;
var
  // this is local variable
  i: Integer;
begin
  for i:=0 to 10 do // some code here
end;
Global variables can be initialized by some default value:
var
  Start: Integer = 99;
  URL: string = 'http://www.greatis.com';
Delphi compiler fills all the global variables by zero values, so you don't need to initialize your variables when you need nil pointers, empty strings, zero in integers and doubles, etc.
var
  // redundant code:
  Start: Integer = 0;
  URL: string = '';
  Ptr: Pointer = nil;
var
  // write it instead:
  Start: Integer;
  URL: string;
  Ptr: Pointer;
Variables can be grouped when declaring several variables of one type:
var
  StartValue, EndValue: Integer;
 
 
  C#

Variables can be declared any where in block before using its.
Variables can be initialized in declaration and must be initialized before using it.
Uninitialized variable have null default value.
There are no global variables in C#.
void Foo()
{
   int i = 1; // declaration and initialization
   int j;

   j = i + 1; // ok initialization before using

   int k;

   j = k + 1; // error using variables before initializing
}

Lost features      There are no global variables.
Added features Variable can be declarated in any code block immediately before using.
Warnings Do not forget, that null is not nil or zero value. Null is indicated unitilized variable that cannot be used before assigning some value.
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