Script debugging

 From:  Michael Gibson
8264.4 In reply to 8264.1 
Some excellent tips from Brian above, thanks Brian!

For getting information about what's going on you put in moi.ui.alert( 'text' ); to pop up an alert dialog. If you need to spew out a bunch more information you can instead use moi.log( 'text' ); which will put the text into MoI's text log instead of popping up a dialog, then the whole log can be shown with a shortcut key with script:moi.ui.createDialog( 'ShowLog.htm' );

And that's about it currently... Definitely doing things in an incremental way like Brian describes helps a lot. In the future I would like to work on making it easier to do this with some kind of integrated script debugger where you could set breakpoints and view variable values and things like that, but I won't know how much work is involved until I dig into it some.

@Brian, re:
> Script in the .htm file lacks "debug" help, and may not work for "peculiar reasons", so it
> is better to script in the .js file, and later move it to .htm script section for speed, if needed.

One of the things that I've changed with v4 is that the script from the .js file will now be run directly in the main thread instead of in a separate moi_commandprocessor.exe process, so there won't be any speed penalty for the .js code anymore. The down side of this though is that it will be easier to lock up MoI if the script goes into an infinite loop or something but that will already happen anyway with code run on the .htm side of things.

- Michael