01-05-2008, 05:33 PM
Put atend at the beginning, before an error can be generated.
I made the example easier to understand:
I made the example easier to understand:
;If macro ends due to an error, log the error to qmlog.txt file which is in My Documents\My QM:
;Insert this at the beginning of each macro that needs error logging:
atend LogErrors
;And create function LogErrors:
if(_error.source) ;;macro ended due to an error
,str macroname.getmacro(getopt(itemid 3) 1)
,str functionname.getmacro(_error.iid 1)
,str s.format("Macro %s ended due to an error in %s.[]Error description: %s[]Error line: %s[]" macroname functionname _error.description _error.line)
,LogFile s 1