View unanswered posts | View active topics It is currently Mon Apr 27, 2026 10:28 am



Reply to topic  [ 1 post ] 
 SWATH UserDefinedCommand: initInstance vs. initCommand 
Author Message
Gunnery Sergeant

Joined: Tue Jul 05, 2011 3:37 pm
Posts: 24
Unread post SWATH UserDefinedCommand: initInstance vs. initCommand
I wrote a simple UserDefinedCommand called TradeAll and a UserDefinedScript that uses it. I noticed that the exec() methods in other people's UDCs were calling initInstance() and execInstance() instead of initCommand() and startCommand(), so I copied this without understanding it.

But when I ran it, SWATH 1.9.8 hung on executing the UDC. (It said "cmd: TradeAll" in the status bar.) I added some trace messages and discovered that my command was getting executed, but it hung after returning from the startCommand() method.

When I call initCommand() and startCommand() myself, it works.

Can anyone explain what's going on? Why do people call initInstance() and execInstance()?

Code:
public static void exec() throws Exception {
   TradeAll cmd = new TradeAll();
   //cmd.initInstance();
   //cmd.execInstance();
   if(cmd.initCommand()) cmd.startCommand();
}


Sun Jul 24, 2011 3:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 63 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.