Author Topic: Merging of scripting_squirrel branch to trunk is planned  (Read 8373 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Merging of scripting_squirrel branch to trunk is planned
« on: July 03, 2006, 01:33:53 pm »
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.
« Last Edit: July 03, 2006, 01:47:35 pm by mandrav »
Be patient!
This bug will be fixed soon...

nfz

  • Guest
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #1 on: July 03, 2006, 05:06:05 pm »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #2 on: July 03, 2006, 06:46:02 pm »
I'd like to extend mandrav's list with one additional point:
  • 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

nfz

  • Guest
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #3 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #4 on: July 04, 2006, 08:11:13 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...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #5 on: July 04, 2006, 02:26:35 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #6 on: July 04, 2006, 02:33:46 pm »
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

  • Guest
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #7 on: July 04, 2006, 02:36:30 pm »
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.....

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Merging of scripting_squirrel branch to trunk is planned
« Reply #8 on: July 04, 2006, 02:57:58 pm »
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...