Home AMX User Forum NetLinx Studio

Bitten yet again!

Well I got bit by the same old compiler error once again.
ERROR: ................Mod.axs(9951): C10201: Syntax error; Illegal or Invalid syntax in code  

on these two new blocks:
             ACTIVE(nBtn == SBS_BTN_TRKINFO_BACK)://281
                  {
                  fnFB_DoSend_CHNL(UI_UPDATE_ACTIVE,nBtn,CH_PULSE);
                  if(sTrkInfo.nLevel > 1)
                   {
                   STACK_VAR _sTrkInfoLVL sZeroLevel;
                   STACK_VAR _sTrkInfoLVL sZeroList[MAX_TRK_INFO_LINES];
                    
                   sTrkInfoLVL[sTrkInfo.nLevel] = sZeroLevel;
                   sTrkInfoList[sTrkInfo.nLevel] = sZeroList;
                   sTrkInfo.nLevel--;
                   fnFB_Update_TrkInfoList(UI_UPDATE_ACTIVE,NOFORCE,NOCLEAR);
                   }              
                  }
             ACTIVE(nBtn == SBS_BTN_TRKINFO_EXIT)://291
                  {
                  STACK_VAR INTEGER i;
                  STACK_VAR _sTrkInfoLVL sZeroLevel;
                  STACK_VAR _sTrkInfoLVL sZeroList[MAX_TRK_INFO_LINES];
                  
                  fnFB_DoSend_CHNL(UI_UPDATE_ACTIVE,nBtn,CH_PULSE);
                  for(i = sTrkInfo.nLevel; i; i--)
                   {
                   sTrkInfoLVL[i] = sZeroLevel;
                   sTrkInfoList[i] = sZeroList;
                   }
                  fnFB_DoSend_UI_CMD(UI_UPDATE_ACTIVE,'PPOF-SBS_TrkInfoList');
                  fnFB_Update_TrkInfoList(UI_UPDATE_ACTIVE,NOFORCE,CLEAR);
                  }
The error was in the 1st Active at this line:
sTrkInfoLVL[sTrkInfo.nLevel] = sZeroLevel;
And once again I spent 10 minutes scratching my head trying to figure out WTF was wrong until it dawned on me yet again that it was that stupid compiler error where the compiler doesn't approve of setting arrays or structures on the 1st line after declarations and once again I had to add a freakin' line of code for no other reason but to appease the compiler like so:
          ACTIVE(nBtn == SBS_BTN_TRKINFO_BACK)://281
                  {
                  fnFB_DoSend_CHNL(UI_UPDATE_ACTIVE,nBtn,CH_PULSE);
                  if(sTrkInfo.nLevel > 1)
                   {
                   STACK_VAR INTEGER i;
                   STACK_VAR _sTrkInfoLVL sZeroLevel;
                   STACK_VAR _sTrkInfoLVL sZeroList[MAX_TRK_INFO_LINES];
                    
                   i++;
                   sTrkInfoLVL[sTrkInfo.nLevel] = sZeroLevel;
                   sTrkInfoList[sTrkInfo.nLevel] = sZeroList;
                   sTrkInfo.nLevel--;
                   fnFB_Update_TrkInfoList(UI_UPDATE_ACTIVE,NOFORCE,NOCLEAR);
                   }              
                  }
You would think this to be an easy fix at AMX but year after year I keep getting bitten by this stupid $hit. On the bright side I am catching it quicker than I did early on but it would be nice if someone would address some of these looooooooong standing issues.

The worst part about this isn't the wasting of my time but breaking my train of thought, as I get older I'm finding it harder to get back into the groove and remember WTF I was trying to do before getting side lined.

Comments

  • a_riot42a_riot42 Posts: 1,624
    Surely you've been around long enough to know the compiler isn't going to get modified. I can't think of the last time it was, or if it can be done. I would imagine if it could have been done it would have been done by now.
    Paul
Sign In or Register to comment.