Sign in to follow this  
B_old

Small question about ExecuteString and scriptstring vs. scriptstdstring

Recommended Posts

B_old    689
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
WitchLord    4678
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
B_old    689
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
B_old    689
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this