Advertisement

Does parameters names stored?

Started by October 07, 2015 10:19 PM
1 comment, last by Alexander Orefkov 9 years, 1 month 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?

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

Advertisement

O, it works!!!

Many thanks, Andreas!

This topic is closed to new replies.

Advertisement