> For example, the macro:
>
> dialog(2 + 1 / 0)
>
> crashes with division by zero. $failure gives text positions 11 to 16 (with
> 'd' at position 0), so you highlight the operator and arguments causing the
> crash as follows:
> err = $failure
> if (err.menu != "") {
> edit_macro(err.menu, err.menu_item, err.start, err.end)
> dialog("Error calling " err.menu " entry " err.menu_item "\n" \
> "from window " err.called_from "\n" \
> "Error was:\n" err.error)
> }
> (The above doesn't check $failure for valid content; so if you run it before
> any failure occurs, it'll fail. Run it a second time and it'll identify the
> problem as the array key ".menu" in the second line.)
I haven't tried it, but what happens, if the error is in a macro
loaded with load_macro_file()?
Also, a new button in the error dialog, that pop ups the EditMacro
window would be great too.
Bert
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop