如何在批处理中检查批处理提示操作选择?
How to Check the Batch Promt action choice, in Batch processing?
在我的 customClass extends RunBaseBatch
方法中 main
我需要检查在 Batch Promt[=26 中选择的选项=](如果是 OK 或 Cancel),如果标记 批处理 被选择为 ON。
server public static void main(Args _args = null)
{
MyCustomClass_BATCH localMyCustomClass_BATCH;
localMyCustomClass_BATCH= new MyCustomClass_BATCH ();
if (localMyCustomClass_BATCH.prompt() )
{
localMyCustomClass_BATCH.run();
}
// HERE I want to check the action selected, if it's OK or Cancel.
}
谢谢大家
如果prompt
return为真,则按了OK,不在批处理中。
它 returns false,如果按下取消或选择了批处理。
OK/Cancel 不属于批处理窗格,而是属于运行基础对话框。
您可以测试是否选择了批次,但我没有看到一个很好的用例。
server public static void main(Args _args)
{
MyCustomClass_BATCH myThing = new MyCustomClass_BATCH();
if (myThing.prompt())
myThing.run(); // OK, not in batch
else if (myThing.batchInfo().parmBatchExecute())
info("We will go batch");
else
info("Action cancelled");
}
如果按下取消,myThing.batchInfo().parmBatchExecute()
return false,即使在对话框中选中了"Batch processing"。检查 RunBaseBatch.prompt
的来源以了解原因。
在我的 customClass extends RunBaseBatch
方法中 main
我需要检查在 Batch Promt[=26 中选择的选项=](如果是 OK 或 Cancel),如果标记 批处理 被选择为 ON。
server public static void main(Args _args = null)
{
MyCustomClass_BATCH localMyCustomClass_BATCH;
localMyCustomClass_BATCH= new MyCustomClass_BATCH ();
if (localMyCustomClass_BATCH.prompt() )
{
localMyCustomClass_BATCH.run();
}
// HERE I want to check the action selected, if it's OK or Cancel.
}
谢谢大家
如果prompt
return为真,则按了OK,不在批处理中。
它 returns false,如果按下取消或选择了批处理。
OK/Cancel 不属于批处理窗格,而是属于运行基础对话框。
您可以测试是否选择了批次,但我没有看到一个很好的用例。
server public static void main(Args _args)
{
MyCustomClass_BATCH myThing = new MyCustomClass_BATCH();
if (myThing.prompt())
myThing.run(); // OK, not in batch
else if (myThing.batchInfo().parmBatchExecute())
info("We will go batch");
else
info("Action cancelled");
}
如果按下取消,myThing.batchInfo().parmBatchExecute()
return false,即使在对话框中选中了"Batch processing"。检查 RunBaseBatch.prompt
的来源以了解原因。