web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Reflection code to run methods in a class

Fawad Hassan Profile Picture Fawad Hassan 337

Code to run all methods in a class through reflection

static void callMethodJob(Args _args)

{

DictClass dictClass = new DictClass(classNum(TestClass));

DictMethod dictMethod;

int i;

for (i=1; i < dictClass.staticMethodCnt(); i++)

{

if (Global::strStartsWith(dictClass.staticMethod(i), “create”))

{

dictClass.callStatic(dictClass.staticMethod(i));

}

info(strFmt(“%1, %2, %3″, dictClass.staticMethodCnt(), dictClass.staticMethod(i), dictClass.name()));

}

}



This was originally posted here.

Comments

*This post is locked for comments