• Advertisement
Sign in to follow this  

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

This topic is 1654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement