Get the current Pass no while in Strategy Tester

 
Hi,

I am trying to obtain the number of Pass currently executed while in an optimization.

The idea is that while in a Slow Complete algorithm I want to execute only certain steps.


Up to now, I tried this by using a terminal Global Variable created _within_ the Optimization (as the normal terminal GV variables cannot be used) but this doesn't work.

Can somebody please confirm whether my code below is correct ?
Also, is there a way to use OnTesterPass to get the Pass number, without writing and reading to / from an external file ?

Thank you very much.


double pass_no;
...
int OnInit() 
{
   if ( GlobalVariableTemp("g_pass_no") )
   {
      GlobalVariableSet("g_pass_no",1);
   }
   else
   {
      pass_no = GlobalVariableGet("g_pass_no");
      if (pass_no < 3)
         {
            return( INIT_PARAMETERS_INCORRECT );
         }
      GlobalVariableSet("g_pass_no", pass_no++);
   }
...
}