Listers.count anomaly

With no listers open to start with, when running the following test code from a CLI window or a JScript button a new lister is opened but the resulting log output (after the lister is opened) is "0 listers are open."

Regards, AB

// listers.count anomaly function dbg(str){if (debug) DOpus.Output(str);} var debug = true; var objCmd = DOpus.CreateCommand; if (DOpus.listers.count == 0) objCmd.runcommand("Go /homeroot NEW"); dbg(DOpus.listers.count + " listers are open."); var Listers = DOpus.listers; if ('object' == typeof Listers.lastactive) objCmd.SetSourceTab(Listers.lastactive.activetab); objCmd.runcommand("Set UTILITY=otherlog,toggle");

What happens if you DOpus.Delay(1000); after Go and before testing the count?

Same result on my system. I also tried it with a delay of 10000. Still says 0 listers are open.

Regards, AB

When the Listers collection is instantiated it takes a snapshot of the current state. It doesn't update in real time. Use the Update method to update after changes.