Home AMX User Forum AMX General Discussion

#INCLUDE bug?

I just had odd error which took a few minutes to figure out.
ERROR: C:\Path\AMX\File\Netlinx_Code\VAV_File.axs(822): C10201: Syntax error; Illegal or Invalid syntax in code  
Now the only thing I did in this area was to move the order of an include file and then I added a comment after so I would later know why I moved it. Gettin' old ya know. The inlcude location was several line above where the error called it.
#INCLUDE 'VAV_Date_&_Time.axi'//put system clocks last
I moved it back and the problem move accordingly but still a few lines off which is normal for netlinx but I figured WTF nothing changed and then I realized I did add the comment and sure enough when I removed it and re-compiled the error was gone. I thought well that's stupid, I can't have a comment after the include but I do have commented lines on the next lines and spaces aren't supposed to matter so what gives. It appear that after an include you need at least one space otherwise you get an error. Which I gues is why I could never put a semi-colon directly after the include but if I add a single space it's fine.
#INCLUDE 'VAV_AV_System.axi' ;
#INCLUDE 'VAV_Date_&_Time.axi' //put system clocks last
Apprently this is the first time I've ever attempted to put a comment directly after an inlcude and the semi-colon after includes I just gave up on years ago.

Comments

  • I have this sequence in currently functioning code (actual include names have been changed):
    #INCLUDE 'someInclude.axi'
    //#INCLUDE 'someComment.axi'
    #INCLUDE 'someOtherInclude.axi'
    
  • I don't seem to have a problem with this...
    // ****************************************************************************
    //	Include Files
    // ****************************************************************************
    //	Include AMX Standard Netlinx API
    #INCLUDE 'SNAPI.axi';
    
    //	Application System Compiler Switches
    #INCLUDE 'SYS_Compiler.axi';//comment
    
    //	Include AMX Framework Library of Functions
    #INCLUDE 'AFL_System_2_0.axi';
    #INCLUDE 'AFL_Variables.axi';
    #INCLUDE 'AFL_Shutdown.axi';
    
  • viningvining Posts: 4,368
    I don't seem to have a problem with this...
    // ****************************************************************************
    //	Include Files
    // ****************************************************************************
    //	Include AMX Standard Netlinx API
    #INCLUDE 'SNAPI.axi';
    
    //	Application System Compiler Switches
    #INCLUDE 'SYS_Compiler.axi';//comment
    
    //	Include AMX Framework Library of Functions
    #INCLUDE 'AFL_System_2_0.axi';
    #INCLUDE 'AFL_Variables.axi';
    #INCLUDE 'AFL_Shutdown.axi';
    
    Hmmm, what NS build? I'm using 3.3.1.325, compiler 2.5.2.20. I've never been able to use a semi-colon directly after unless maybe I'm just losing my mind.
  • I think you meant:
    3.3.1.525, compiler 2.5.2.20
    and that is what I am using.
Sign In or Register to comment.