News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Merging of scripting_squirrel branch to trunk is planned

Started by mandrav, July 03, 2006, 01:33:53 PM

Previous topic - Next topic

mandrav

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 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.
Be patient!
This bug will be fixed soon...

nfz

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.

MortenMacFly

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

nfz

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.

mandrav

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 ?) :).
Be patient!
This bug will be fixed soon...

MortenMacFly

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?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mandrav

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.
Be patient!
This bug will be fixed soon...

sethjackson

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.....

mandrav

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...
Be patient!
This bug will be fixed soon...