.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  

       for loop is used when you know the number of iterations. Loop variable must be local declared. It can be of any ordinal type:
var
  i: Integer;
  c: Char;
  ...
  for i:=1 to 10 do // some code
  for c:='A' to 'Z' do // some code
If initial value less than final value downto must be used instead of to:
for i:=100 downto 1 do // some code
In earlier versions of Delphi you can modify the loop variable within the loop code, but it is not recommended due to code optimization in the last versions of Delphi:
for i:=1 to 10 do
begin
  if i=ValueWeWantToIgnore-1 then Inc(i); // < don't use this way!
  // some code
end;
 
 
  C#

The for loop executes a statement or a block of statements repeatedly until a specified expression evaluates to false.
The for loop is handy for iterating over arrays and for sequential processing.
for( int i = 1; i < 100; i++ )
{
  // do something
}
You can use any start and end value and any counter operation:
for( int i = 100; i > -100; i-=5 )
{
  // do something
}

Lost features     
Added features Simple and flexible syntax - no more strange downto.
Warnings
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