Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

No matching signatures to 'string::split(const string)'


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Sir Ementaler   Members   -  Reputation: 573

Like
0Likes
Like

Posted 13 August 2013 - 08:22 AM

The topic title is the error I got when I made an attempt to use the split method from inside a script. The way I call it is really nothing fancy, it looks like this:

string text="Line 1\nLine 2";
array<string> line=text.split("\n");

AngelScript manual lists it as one of methods supported by strings. It's said to be a version 2.21.0 addition along with substr, findFirst and findLast methods, all of which appear to work correctly as opposed to split.



Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9628

Like
0Likes
Like

Posted 13 August 2013 - 08:28 AM

split() isn't one of the standard string functions, it needs to be registered with RegisterStdStringUtils() from the scriptstdstring add-on. 



#3 Andreas Jonsson   Moderators   -  Reputation: 3416

Like
0Likes
Like

Posted 13 August 2013 - 11:47 AM

The reason that split() isn't registered with the call to RegisterStdString() is that it requires both the array and string objects to be regstered first.

 

Manual: string add-on


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#4 Sir Ementaler   Members   -  Reputation: 573

Like
0Likes
Like

Posted 13 August 2013 - 06:13 PM

Alright, thanks, sorry for bothering you then. I write scripts for a game but I'm not the person responsible for its AngelScript implementation, which makes me occasionally incorrectly guess who I should report errors to.



#5 Andreas Jonsson   Moderators   -  Reputation: 3416

Like
0Likes
Like

Posted 14 August 2013 - 12:08 PM

No problem. You're welcome to post here any time you wish. :)

 

May I ask what game it is?

 

Ideally the game developer should provide its own manual for the script writers, as each application/game will provide their own interfaces and possibly even customizing the script language to suit their needs.

 

Regards,

Andreas


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#6 Sir Ementaler   Members   -  Reputation: 573

Like
0Likes
Like

Posted 15 August 2013 - 05:16 PM

It's Jazz Jackrabbit 2 Plus. In defense of its creators, the scripting manual they provided fulfills its main task, which is explaining JJ2+ implementation of AngelScript and the custom classes, functions and variables it adds. For basic AngelScript usage it only contains a link to the same manual I linked to in the OP, and this is the first time I found anything in it that failed to work within my script, hence my confusion.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS