quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif foreach

Vera supports the foreach construct for single dimensional fixed-size arrays, dynamic arrays and SmartQs. Associative arrays, string mapped associative arrays and multi-dimensional arrays are not supported.

   

space.gif

Syntax : foreach

   

space.gif

foreach (name, loop_variable){
 statements;
}
   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example : foreach
   

space.gif


 1 program foreach_statement {
 2   string magic[$] = {"ASIC","WORLD","DEEPAK","KUMAR", "TALA"};
 3   integer i = 0;
 4   foreach (magic,i) {
 5     printf("String at index %0d is %s\n",i,magic[i]);
 6   }
 7 }
You could download file foreach_statement.vr here
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation : foreach
   

space.gif

 String at index 0 is ASIC
 String at index 1 is WORLD
 String at index 2 is DEEPAK
 String at index 3 is KUMAR
 String at index 4 is TALA
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com