"For Loop" problem

 

I want to print value of "i" but that is printed incorrectly and it does not start printing from zero

This problem does not exist for loops with repetitions below 100(or 150)

for(int i=0; i<500;i++)
{
Print(i);
}
 

When you post code please use the Code button (Alt+S) !

Please EDIT your post and use the CODE button when you post code.

Code button in editor

 
Fernando Carreiro #:

When you post code please use the Code button (Alt+S) !

Please EDIT your post and use the CODE button when you post code.


thank you

I edited my comment
 
amin parvini: I want to print value of "i" but that is printed incorrectly and it does not start printing from zero. This problem does not exist for loops with repetitions below 100(or 150)

It's working just fine for me ...

void OnStart() {
   Print( "Start ..." );
   for( int i=0; i<8; i++ ) {
      Print( i );
   };
   Print( "... Stop" );
};

Results ...


 

And now for 800 ...




 
amin parvini:

I want to print value of "i" but that is printed incorrectly and it does not start printing from zero

This problem does not exist for loops with repetitions below 100(or 150)

The experts tab may not be showing all the printed values. Open the log file and check for all values.
 
@Navdeep Singh #The experts tab may not be showing all the printed values. Open the log file and check for all values.

You can also just right-click and us the "Viewer" which also allows you to filter based on dates or keywords.


 
Fernando Carreiro #:

You can also just right-click and us the "Viewer" which also allows you to filter based on dates or keywords.


Right, forgot about that thanks.
 

Also, it is a good practice to use conversion functions with Print().

for ( int i = 0; i < 500; i++ )
{
        Print( IntegerToString(i) );            // in this case
}

@Fernando Carreiro: Thanks for the "Viewer" info.  It will be very helpful in the future.

Reason: