On Tue, 11 Dec 2018, Rich wrote:
> Catch captures the return 'code' of the script it is asked to execute,
> and stores it away in the opt dict for you to access later.
And can I get that the script sets an error code of 2 in the opt dict? :)
"""
% catch {return -code return} res opt
2
% set opt
-code 0 -level 2
% catch {return -code 2} res opt
2
% set opt
-code 0 -level 2
""""
Perhaps I am missusing "return -code". Is it harmelss if I do it
behind catch?
Or should I use "return -options" to pass a number?
Behind all of this:
I have a database table with fields: id, date, state, script.
I have a proc that:
(1) execute all scripts in the table where state < 0 and date <= today.
(2) sets state in the table with the number passed by the script with
return.
What is the most elegant way? :)
Thanks
Rodrigo