动态创建对象演示代码MenuFunction ClassFactory FormRun ReportRun
// Changed on 20 May 2006 at 07:02:15 by ZYJ
// 论坛:www.qiuhao.com
// 博客:http://www.qiuhao.com/boke.asp?maxfara.index.html
// 邮箱:Zhouyujie238@hotmail.com
//BestPractice:
//优先使用MenuFunction 来调用对象;
//在不能使用MenuFunction的时候,使用classFactory进行调用;
//不能使用classFactory的时候,再考虑直接使用new FormRun/ReportRun ;
static void menuFunction(Args _args)
{
Args args = new Args();
;
//访问Form;
new MenuFunction(menuItemDisplayStr('Unit'),MenuItemType::Display).run(args);
//访问类
//new MenuFunction(menuItemActionStr('Calculator'),MenuItemType::Action).run(args);
//访问报表
//new MenuFunction(menuItemOutputStr('Currency'),MenuItemType::Output).run(args);
}
static void classFactory (Args _args)
{
Args args = new Args();
FormRun formRun;
;
//调用Form的例子
args = new Args(FormStr('Unit'));
formRun = classFactory.formRunClass(args);
//报表:reportRun = classFactory.reportRunClass(<args object>);
formRun.init();
formRun.run() ;
formRun.wait();
}
static void formRun(Args _args)
{
Args args = new Args();
FormRun formRun;
;
//调用Form的例子
args = new Args(FormStr('Unit'));
formRun = new FormRun(args) ;
//报表:reportRun = new ReportRun(args) ;
formRun.init();
formRun.run() ;
formRun.wait();
}