M
marian.edu
Guest
Ok, we have a GPF caused by a simple code that tries to see if a string is formatted as a date. &if keyword-all('routine-level') ne ? &then routine-level on error undo, throw. &endif function getDate returns date (strIn as longchar): if num-entries(strIn, '-') ne 3 then do: message 'throw' view-as alert-box. return error. end. return date(integer(entry(2, strIn, '-':u)), integer(entry(3, strIn, '-':u)), integer(entry(1, strIn, '-':u))). end. define variable dt as date. dt = getDate('noc/007-') no-error. message dt skip error-status:error skip error-status:num-messages view-as alert-box. This is on 10.2B, well the customer seems to be on 10.1C and upgrade isn't an option so please don't start 'singing' you should upgrade
If the input parameter is changed to character then we do get the error, 'invalid entry 3' but we do have to work with longchar cause we do not know what is there really
Funny thing is trying to get around that I'm attempting to throw an error if num-entries aren't what we expect, it must have been the time when 'structured error handling' entered the stage cause no error seems to be thrown, I can't catch it, doing the assignment with no-error leaves the error-status:error set to false, num-messages is 0.
Continue reading...
Continue reading...