Forum Discussion
HKosova
Alumni
14 years agoHi Rebecca,
I don't see the behavior you describe using the following script. AddMethod doesn't run the method being added; the method is only executed when called directly - just as expected.
Could you please post here your test project so we can take a closer look at what's going on? If you can't post it on a public forum, you can send it privately to our Support Team using this form.
I don't see the behavior you describe using the following script. AddMethod doesn't run the method being added; the method is only executed when called directly - just as expected.
// Unit1
function Main()
{
ODT.Classes.Clear();
ODT.Classes.Declare("MyClass");
var obj = ODT.Classes.New("MyClass");
Log.Message("Before AddMethod")
obj.AddMethod("Test", "Unit1.Test");
Log.Message("After AddMethod");
Log.Message("Now calling the newly added method:")
obj.Test();
}
function Test()
{
Log.Message("Hello from Test!");
}
Could you please post here your test project so we can take a closer look at what's going on? If you can't post it on a public forum, you can send it privately to our Support Team using this form.