for-in loop

Top  Previous  Next

What is translated > Statements > for loop's > for-in loop



for-in loops are a special kind of Delphi for-loops which have the syntax:




  a : typename;


for a in B do




where 'a' may be a character in a string 'B' or  'a' may be an element of an array 'B' or  'a' may be a member of a set 'B'. All these cases are translated to a C# for_each statements:


typename a;


foreach (typename element_0 : B)


  a = element_0;







This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content