Test in the script console :
-----------------------------
if (1) print(_T("1")); else print(_T("2")); print(_T("3"));
or
if (1) {print(_T("1"));} else {print(_T("2"));} print(_T("3"));
------------------------
Will produce an error:
------------------------
Filename: ScriptConsole
Error:end of statement expected (; or If)
Details: ScriptConsole line = (1) column = (49) : error end of statement expected (; or If)
=================
As long as the "IF" statement does not follow the statement, there will be no error.
For example:
print(_T("3"));if (1) print(_T("1")); else print(_T("2"));
====================================================
I originally wanted to insert the version number of the library file in the path, so I used the following settings.
If the project does not provide a version number variable "wx_ver", the global variable "wx.ver" is used:
The compile variable :
path_inc =
$(CODEBLOCKS)\..\..\include\wxWidgets\[[local v_1=ReplaceMacros(_T("$(wx_ver)")); local s_1=ReplaceMacros(_T("$(#wx.ver)")); if (!(v_1.IsEmpty() || v_1.len()<3)) print(s_1); else print(v_1);]]\include" -I"$(CODEBLOCKS)\..\..\lib\wxWidgets\[[local v_1=ReplaceMacros(_T("$(wx_ver)")); local s_1=ReplaceMacros(_T("$(#wx.ver)")); if (!(v_1.IsEmpty() || v_1.len()<3)) print(s_1); else print(v_1);]]\shared\dll_i686\mswu$(debug_wx)
My project build option -> search directories ->Compiler :
$(path_inc)
-------------------------------------------
No error if there is no second [[ ... ]] .
--------------------------------------------
After a lot of combination tests, I found that it was the kind of error I encountered earlier.
I couldn't add any script content after the "if" statement, otherwise it would go wrong.