Char to Integer
Posted in 2004
Topics: Error Codes & Troubleshooting
List , I am storing a string variable (which can be integer or alpha ) into an integer variable to check for alpha character's in the string variable. The process works fine as I check whether the integer is null after the assignment ( that is the assigment succeeds or not). null means it could not convert the string to integer . The Problem is that if the assignment fails it generates a error code -1213 in the error log , which is not desirable . I am using "WHENEVER ERROR CONTINUE" earlier on in the code. I want to turn of wrror logging only for this condition . Is there a way I can suppress this benign error from being written to the error log .Pl suggest any other function to check for aplha characters in a string apart from scanning the whole string and exiting when an alpha character is found . rgds, NSV _________________________________________________________________ Fast. Reliable. Get MSN 9 Dial-up - 3 months for the price of 1! (Limited-time Offer) http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/ sending to informix-list
> Is there a way I can suppress this benign error from being written to the > error log .Pl suggest any other function to check for aplha characters in a > string apart from scanning the whole string and exiting when an alpha > character is found . I do believe the conversion has to walk through the string... Regards
Within SPL, you could use the ON EXCEPTION clause to suppress that error.