Home AMX User Forum NetLinx Studio

Major system error

Good evening or morning depending on when you read this...

I'm getting a "C10580: Internal Error: Major system error occurred during code generation" when compiling. I've determined it to a switch case that I added. I comment the particular case out and it is happy.

Anyone see problems with this code within a function?

cTEMP_GAME is declared as: CHAR cTEMP_GAME[10]
SWITCH (cTEMP_GAME)
{
     CASE 'FO':
          SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
}


Thanks for the help in advance!

Comments

  • a_riot42a_riot42 Posts: 1,624
    I don't see anything wrong there. You might want to post the rest of it as well.
    Paul
  • Joe HebertJoe Hebert Posts: 2,159
    There are 2 situations that I know of that will cause a major system error.

    1) A single character CASE above a multi character CASE (which I assume is your issue.) So if you have something like this:
       CHAR cTEMP_GAME[10]
    
       SWITCH (cTEMP_GAME)
       {
    	CASE 'A':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
    	CASE 'FO':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
       } 
    

    You’ll need to change it to this:
       CHAR cTEMP_GAME[10]
    
       SWITCH (cTEMP_GAME)
       {
    	CASE 'FO':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
    	CASE 'A':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
       }
    

    2) Two functions with the same name.

    If anyone knows of any other ways to cause a major system error, this would be a good thread to post it in.
  • A single character CASE above a multi character CASE

    You nailed it! Who would of thought??? Putting the multi-character cases first...

    Is there a reason behind that or is it just a bug in NetLinx Studio?

    Thanks for the help. It's compiling now! :)
  • PhreaKPhreaK Posts: 966
    I believe that the compiler will try to type cast all case values based on the datatype of the first statement. In your case (so to speak) attempting to cast a character array back to a single character confuses it somewhat.
  • mpullinmpullin Posts: 949
    Possible alternative
    SWITCH ("'@',cTEMP_GAME")
       {
    	CASE '@A':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
    	CASE '@FO':
    	     SEND_COMMAND dvTP_SCORES,"'^BMF-',ITOA(380+nMENU_COUNT),',0,%TFinal-OT'"
       }
    
  • ROOROO Posts: 46
    End of line - Major system error

    I don't remember the specific error but "Major system error occurred during code generation" sounds like the error I've seen was cause by a copy/paste error. The End of Line characters (CR LF) only had a CR or LF instead of both. To find it select the "Show End of Line" option in NetLinx Studio and looked for the bad EOL. Hope that helps someone.
  • zerkalozerkalo Posts: 19
    edited November 2018

    Anyone know where one can set this "show end of line" option?

  • zerkalozerkalo Posts: 19
    edited November 2018

    Never mind. I used Sublime text to check the line endings. They were fine.

    But I got rid of this error, somehow, by rearranging definitions and trying this & that. No idea of the cause. I had no SWITCH in the module.

  • Also happens when you have two function definitions with the same name. Simple copy/paste mistake. Weird that the compiler isn't smarter about that.

    The setting for 'show end of line' is in menu: 'edit ' > 'advanced'.

  • jjamesjjames Posts: 2,908

    It's been a while since I've done some NetLinx code and I ran into this. I chased my tail for a good 20 minutes.

    define_device
    dvRoku = 00000 : FIRST_LOCAL_PORT + 1 : 00; // Don't do that...
    
  • I've just started learning to program in Netlinx, and the first code I knocked up and compiled resulted in this error, first time round.
    I was using Netlinx Studio on Windows 10, through VirtualBox on a Mac. But when I transferred to a PC, running Windows 10, it compiled no problem. Same code, no changes.

  • This is one of the more frustrating compiler error messages. No guidance to a line number or further descriptive messaging to point you into a direction. I encountered one recently when I inadvertently pasted a function declaration twice. In general, it is code related and block comment/uncomment is typically how I try to chase these issues down.

Sign In or Register to comment.