Sign in to follow this  
Alexander Orefkov

Does parameters names stored?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
WitchLord    4678

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

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