Hi,
a long time ago I got some help in this forum:
You probably can use squirrel scripting to do what you want...
[[if(ReplaceMacros(_T("$TARGET_NAME")).Matches(_T("Debug"))){print("MYDEBUG");} else {print("MYRELEASE");}]]
That script worked very well but now I need to change that script. I don't want to check, if the build target is "Debug". I want to check, if the target contains "Debug". Basically I want this:
[[if(ReplaceMacros(_T("$TARGET_NAME")).Contains(_T("Debug"))){print("MYDEBUG");} else {print("MYRELEASE");}]]
This doesn't work, because 'Contains' is not a valid keyword."No problem" I thought, just google the squirrel documentation. But I'm surprised to find that there isn't even 'Matches' mentioned anywhere in the documentation. So I'm at a loss here. Can anyone point me to a documentation about squirrel scripting for Code::Blocks?
https://wiki.codeblocks.org/ (https://wiki.codeblocks.org/) gives me a "Service Unavailable".
Thanks in advance,
BackInTheSandbox
There are bindings in C::B source for many wxString methods, see src\sdk\scripting\bindings\sc_wxtypes.cpp
BindMethod(v, _SC("Matches"), wxString_Matches, _SC("wxString::Matches"));
You can add one binding for Contains() (it should be straightforward) or continue using Matches() with wildcards.
EDIT: You can also use Find().