Hey!
The variadic arguments are supported in angelscript?
Im looking for something like this:
void CAngelScript::printf(string format, ...)
{
const char * c_format = format.c_str();
va_list ap;
va_start(ap, c_format);
vprintf(c_format, ap);
va_end(ap);
return;
}
//later
r = this->engine->RegisterGlobalFunction("void printf(string , ...)", asMETHOD(CAngelScript, printf), asCALL_THISCALL_ASGLOBAL, this); assert(r >= 0);
And the script:
void OnScriptInit()
{
printf("%s-%d", "test", 1);
return;
}
↧