Won't compile - why?
jjames
AMX Sustaining Engineer
Just wrote a module, and I like to line things up and such in code, and I'm wondering why this won't compile:
but this will:
Any ideas?
DEFINE_MODULE 'ZTUNER_GUI_COMM' ZTUNER1 ( vdvZTUNER ,// VIRTUAL DEVICE dvZTUNER ,// REAL DEVICE dv_TP ,// TOUCH PANELS THAT CONTROL ABOVE REAL DEVICE nZTUNER_BTNS ,// ZTUNER BUTTONS nZTUNER_PRESETS ,// ZTUNER PRESETS nGUI_OPTIONS // ADDITIONAL TP / ZTUNER OPTIONS )
but this will:
DEFINE_MODULE 'ZTUNER_GUI_COMM' ZTUNER1 (vdvZTUNER ,// VIRTUAL DEVICE dvZTUNER ,// REAL DEVICE dv_TP ,// TOUCH PANELS THAT CONTROL ABOVE REAL DEVICE nZTUNER_BTNS ,// ZTUNER BUTTONS nZTUNER_PRESETS ,// ZTUNER PRESETS nGUI_OPTIONS) // ADDITIONAL TP / ZTUNER OPTIONS
Any ideas?
Comments
-
Parameters of a module must be in (), also if your module would have no parameters.
If you do it absolutely correct, the module definition needs also an instance name (you MUST do this if you use the module in multiple instances):DEFINE_MODULE 'ZTUNER_GUI_COMM' ZTUNER1 'ZTuner1' (vdvZTUNER,// VIRTUAL DEVICE dvZTUNER,// REAL DEVICE dv_TP,// TOUCH PANELS THAT CONTROL ABOVE REAL DEVICE nZTUNER_BTNS,// ZTUNER BUTTONS nZTUNER_PRESETS,// ZTUNER PRESETS nGUI_OPTIONS) // ADDITIONAL TP / ZTUNER OPTIONS
-
The parentheses and instance name are both there in both of his examples, the only difference is how they are placed regarding whitespace and comments. The funny thing is I tried it both ways in some code of mine, and both compiled.
-
Thanks David, I'll have to take a look at the whole picture then rather than focusing on just the module definition; it's probably something really stupid in my code. I'll comment out whatever I can and see if it makes any difference.DHawthorne wrote:The funny thing is I tried it both ways in some code of mine, and both compiled. -
DHawthorne wrote:The funny thing is I tried it both ways in some code of mine, and both compiled.
Not me...I achieved the same results as jjames...different builds of studio???
I have Studio 2.4.0.129
Compiler 2.3.0.0 -
KennyProgram wrote:I have Studio 2.4.0.129
Compiler 2.3.0.0
Same here . . . -
The compiler is having an issue with the last argument. Even if you remove the last comment I believe you will find it will generate an invalid syntax error and not compile.
//Won?t compile DEFINE_MODULE 'ZTUNER_GUI_COMM' ZTUNER1 ( vdvZTUNER ,// VIRTUAL DEVICE dvZTUNER ,// REAL DEVICE dv_TP ,// TOUCH PANELS THAT CONTROL ABOVE REAL DEVICE nZTUNER_BTNS ,// ZTUNER BUTTONS nZTUNER_PRESETS ,// ZTUNER PRESETS nGUI_OPTIONS )
However if you hit the backspace key and bring the closing paren to the same line as the last argument then I believe you will find it compiles fine.//Will compile DEFINE_MODULE 'ZTUNER_GUI_COMM' ZTUNER1 ( vdvZTUNER ,// VIRTUAL DEVICE dvZTUNER ,// REAL DEVICE dv_TP ,// TOUCH PANELS THAT CONTROL ABOVE REAL DEVICE nZTUNER_BTNS ,// ZTUNER BUTTONS nZTUNER_PRESETS ,// ZTUNER PRESETS nGUI_OPTIONS)
Sounds fishy to me. -
Jeremijah, Dave,
sorry, I was blind
(why is the forum not highlighting the source :rolleyes: ) -
I wasn't testing with this exact code; I tried those formats with a module of my own. Perhaps it's dependant on the variable type of the last argument. My computer is on the fritz, and I'm working on another right now, so I can't check what it was with the one I tested (well, not easily, I've only copied over the files I need to work with today from my backup).
-
DHawthorne wrote:I wasn't testing with this exact code.
Me Neither...This is what I used...
Does Not Compile...DEFINE_MODULE 'PolycomVSX8000UI' mdlPolycomVSX8000_APP ( vdvCodec, TPArray, nBTN_ARRAY_POLY_COM )
Does Compile...DEFINE_MODULE 'PolycomVSX8000UI' mdlPolycomVSX8000_APP ( vdvCodec, TPArray, nBTN_ARRAY_POLY_COM)
-
I have had compile issues on multiple occasions in different areas of code, and the only fix was to RE TYPE the entire section.
Tech Support (multiple members) have confirmed this kind of SNAFU does occur. MADDENING... -
I think I have this pinned down: if the last parameter in the module definition is an array, the closing parenthesis has to be on the same line. Tabs don't seem to bother it, or other whitespace, but endlines do. Non-array data types don't seem to have the same prolem.
-
I can confirm what you are seeing Dave. Same results here.DHawthorne wrote:I think I have this pinned down: if the last parameter in the module definition is an array, the closing parenthesis has to be on the same line. Tabs don't seem to bother it, or other whitespace, but endlines do. Non-array data types don't seem to have the same prolem.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums