Small question about ExecuteString and scriptstring vs. scriptstdstring

Started by
3 comments, last by B_old 14 years, 2 months ago
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?
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.

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

Ok, thanks.

Is the reference count used for garbage collecting? Not really sure what my own preference is. :)
instead of creating copies of the object, it adds references. when there is no reference left to object, object dies
Hm, ok. But std::string could be reference counted too, right? Although I think it isn't with visual studio.

This topic is closed to new replies.

Advertisement