How best to skip code on if thn clause. - page 2

 
lippmaje:

When you come across invalid settings you should exit the test run as early as possible, during initialization. This will avoid unnecessary cluttering of the test results.

  • use void OnTick() instead of int start()
  • use int OnInit() instead of int init()
  • add this to your OnInit:

Hi i have got it working using the int init() but when i tried to add in a little more functionality i get unbalanced parentheses. However i cannot seem to put a parenthases in the right place to get rid of the error. I have included a boolean UseTimeSlot and thought it would work as below (I don't think i need an Else but i tried that too) but can not seem to get it right. Any ideas?

Thanks Paxman

int init()
{
if UseTimeSlot = false
{
NumberOfMins = 15
}
{
if(60*EndHr+EndMn<=(60*StartHr+(StartMn+NumberOfMins)))    //extern bool UseTimeSlot = false;
  {
   Print("invalid trading time");
   return INIT_PARAMETERS_INCORRECT;
  }

Reason: