minhterry
10 years agoContributor
How to call method from other UNIT by using EVAL() method
Hi everyone,
I have script A and script B
in Script A i want to call a method FindMyProcess in script B using EVAL
Example:
function testTHIS()
{
eval('//USEUNIT ScriptB;var x=1;FindMyProcess();ShowMessage(x+5);');
}
It does not work because the //USEUNIT look like a comment for that script. And the message will not display.
I don't want to add the //USEUNIT out side eval, because in future, i want to call some script from the method which belong to other script file, such as ScriptC, ScriptD...)
Can any1 suggest me how to do that. Thanks so much.
--
Regards,
MinhT
I have script A and script B
in Script A i want to call a method FindMyProcess in script B using EVAL
Example:
function testTHIS()
{
eval('//USEUNIT ScriptB;var x=1;FindMyProcess();ShowMessage(x+5);');
}
It does not work because the //USEUNIT look like a comment for that script. And the message will not display.
I don't want to add the //USEUNIT out side eval, because in future, i want to call some script from the method which belong to other script file, such as ScriptC, ScriptD...)
Can any1 suggest me how to do that. Thanks so much.
--
Regards,
MinhT