I made a routine that accesses a url, downloads a macro and executes it, enters the url again, downloads another macro and stays there until there is no macro to download.
However I need to know if each execution was successful or had an error.
The problem is that if I use ExecuteFile> it does not collect errors.
When I use Include> it collects the right error, but when I download the other macro it loads into memory because it already has one.
Thanks
Code: Select all
Let>lin=0
Let>MACROS=http://url.com.br/mdj.php
Let>ONERROR=MyErrs
Let>FILEEXEC=%TEMP_DIR%mje_temp.scp
Let>IGNORESPACES=1
// CHECK IF YOU HAVE MACRO FOR EXECUTION
HTTPRequest>MACROS,,GET,,MJD
IF>MJD<>
Repeat>lin
// DATA COLLECTION
HTTPRequest>MACROS,,GET,,MJD
IF>MJD<>
// DOWNLOAD MACRO
HTTPRequest>MACROS,%FILEEXEC%,GET,,salvar
IfFileExists>%FILEEXEC%
Include>%FILEEXEC%
//ExecuteFile>%FILEEXEC%
Wait>8
DeleteFile>%FILEEXEC%
ENDIF
SRT>MyErrs
Msg>LAST_ERROR
Let>ONERROR=donothing
Let>IGNOREERRORS=1
Let>IGNOREERRORS=0
Let>ONERROR=MyErrs
END>MyErrs
SRT>donothing
//dummy error handler when we want to do nothing and ignore
END>donothing
IF>LAST_ERROR<>
Let>ST=99
ELSE
Let>ST=2
ENDIF
Let>lin=lin+1
Wait>10
ELSE
Let>lin=10
ENDIF
Until>lin=10
ENDIF