Jump to content
  • Advertisement
Sign in to follow this  
B_old

Small question about ExecuteString and scriptstring vs. scriptstdstring

This topic is 3055 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

Hi, I just upgraded to version 2.18.1. Gets
int result = m_engine->ExecuteString(0, script, &m_defaultContext, asEXECSTRING_USE_MY_CONTEXT);
replaced by
int result = ExecuteString(m_engine, script, 0, m_defaultContext);
? No need to specify asEXECSTRING_USE_MY_CONTEXT anywhere? And what is the difference between scriptstring and scriptstdstring?

Share this post


Link to post
Share on other sites
Advertisement
Indeed. I changed the ExecuteString works when I moved it to a global function. There are no flags any more, which should make it a bit more straight forward.

If you pass in a context pointer to ExecuteString, it will be used by the function. If you do not, then it will create its own context internally.


The difference between scriptstrstring and scriptstring is that the former is the registration of the std::string as a value type, whereas the latter is the registration of a light wrapper of std::string which adds reference counting. Which is the best to use depends mostly only your own preference.

Share this post


Link to post
Share on other sites
Ok, thanks.

Is the reference count used for garbage collecting? Not really sure what my own preference is. :)

Share this post


Link to post
Share on other sites
instead of creating copies of the object, it adds references. when there is no reference left to object, object dies

Share this post


Link to post
Share on other sites
Hm, ok. But std::string could be reference counted too, right? Although I think it isn't with visual studio.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!