🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Does parameters names stored?

Started by
1 comment, last by Alexander Orefkov 8 years, 8 months ago

Hi.

I try use this code to get param names:


...
asIScriptFunction* pMeth = pType->GetMethodByIndex(i);
for (unsigned l = 0, m = pMeth->GetParamCount(); l < m; l++) {
    const char *name, *pDef;
    int typeID;
    pMeth->GetParam(l, &typeID, 0, &name, &pDef);
...

but has no param names, no default values.

How I can get it?

Advertisement

You're getting the virtual function table entry this way. The virtual function doesn't contain the parameter names.

To see the parameter names and default values you need to get the implementation of the method, like this:

asIScriptFunction* pMeth = pType->GetMethodByIndex(i, false);

Manual: asIScriptFunction::GetParam

Manual: asIObjectType::GetMethodByIndex

Regards,

Andreas

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

O, it works!!!

Many thanks, Andreas!

This topic is closed to new replies.

Advertisement