Basic "For" Loop

Basic "For" Loop

  
How do write the following "for" loop in Outsystems?
 
//------------------------------
ArrayList MyRecordList = new ArrayList();
 
for(int i=1;i<=10;i++)
{
MyRecordList.Add(i);
}
//------------------------------
 
After the loop is complete, MyRecordList array should contain integer values of 1 to 10.
Hi Robert,

You'll need to create a structure with a single Integer attribute, create a MyRecordList variable and a MyRecord variable and then do a cycle like the image bellow:



Cheers,
Tiago Simões
thanks Tiago

"For each" action wouldn't work?
Hi Robert,

For each only allows you to iterate over an existing list.

Cheers,
Tiago Simões