Here's the other thing, if I try to call an error catching function on a series which does not exist, it should punt when the function call fails at the series declaration, effectively erroring on the error check.
This has *not* been tested since I'm still making sure that I've got the concept thought through well enough.
Any thoughts would be appreciated.
Code: Select all
' Using @errorcount and @maxerrs: get the current conditions and settings
' attempt to perform a null operation and confirm @errcount has not incremented
' return 1 if exists, return 0 if not
subroutine local exist(series passed_series, scalar ret_val)
%beg_err_ct = @errorcount
%max_err_ct = @maxerrs
%end_err_ct = @errorcount
setmaxerrs = %max_err_ct + 1
genr temp_series = passed_series
ret_val = 0
if %end_err_ct = %beg_err_ct then
' the set existed
ret_val = 1
setmaxerrs = %max_err_ct -1
else
'the set did not exist.
seterrcount = @errorcount - 1
setmaxerrs = %max_err_ct -1
endif
endsub