Later today, the scripting_squirrel branch will be merged to trunk. Be prepared :)
I also started writing documentation about scripting in Code::Blocks. Find it here (http://wiki.codeblocks.org/index.php?title=Scripting_Code::Blocks) and tell me if you find something's wrong.
EDIT:For those not following the development of Code::Blocks, we have replaced AngelScript by Squirrel in that branch and have been testing for a week or two.
This means that if you have written scripts for Code::Blocks,
you will have to convert them. Luckily, squirrel follows a C++ syntax too so only a few semantics must be changed in your scripts.
Here are the most important changes:
- All literal strings must be surrounded by _T() (e.g. _T("hello"))
- Squirrel is typeless. If you have a declaration like wxString s="hello";, change it to local s=_T("hello");. Same goes for all types.
- Because of the above, functions don't have return types. So replace all function return specifications with the word function.
This should cover most conversion cases.
Thanks for the heads up. I was just going to submit a project wizard for Ogre + MinGW + STLPort but will hold off and update the script to squirrel format and re-test.
I'd like to extend mandrav's list with one additional point:
Quote from: mandrav on July 03, 2006, 01:33:53 PM
- All literal strings must be surrounded by _T() (e.g. _T("hello"))
- Squirrel is typeless. If you have a declaration like wxString s="hello";, change it to local s=_T("hello");. Same goes for all types.
- Because of the above, functions don't have return types. So replace all function return specifications with the word function.
- Only for string comparision (not e.g. integer): MyString == "MyVal" has to be replaced with MyString.Matches(_T("MyVal"))
This often applies to the compiler comparision, e.g. Wizard.GetCompilerID().Matches(_T("msvctk")). Concerning this there are non-critical pending changes for several wizards, They will be applied soon.
With regards, Morten.
Thanks, I was just going to dive into the scripter and I figured I'd check here first since I was sure someone else had already hit this problem.
Quote from: nfz on July 04, 2006, 04:00:18 AM
Thanks, I was just going to dive into the scripter and I figured I'd check here first since I was sure someone else had already hit this problem.
The point is that I couldn't find out how to overload operator==() in squirrel.
So wxString::Match() comes to the rescue. The good thing about it is that it accepts wildcards (* and ?) :).
Quote from: mandrav on July 04, 2006, 08:11:13 AM
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!
Well, I couldn't find anything about it in the (otherwise excellent) documentation. I didn't bother asking yet because I didn't think it's that important.
Quote from: MortenMacFly on July 04, 2006, 02:26:35 PM
Quote from: mandrav on July 04, 2006, 08:11:13 AM
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!
http://www.squirrel-lang.org/forums/491/ShowPost.aspx
I'm looking at the DXSquirrel sample now.....
Quote from: sethjackson on July 04, 2006, 02:36:30 PM
Quote from: MortenMacFly on July 04, 2006, 02:26:35 PM
Quote from: mandrav on July 04, 2006, 08:11:13 AM
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!
http://www.squirrel-lang.org/forums/491/ShowPost.aspx
I'm looking at the DXSquirrel sample now.....
Before you dive deeply, let me tell you that I know about the _cmp() metamethod and this works for every other comparison except equality...