Hi! I am making a program in VB 2010. In the program I have to use a Try..Catch..End method. It converts a fraction to a decimal. It works perfectly but it is supposed to display a message box when it realizes that denominator isn't a positive integer but I do not know how to do this? I need the Try portion to mandate the integer to be positive and when it realizes its not to use the Catch part.
I don't know VB. I don't want to know VB. The general principal of that type of code is: if( denominator < 1 ) raise Exception Which exits the try and will be caught by the Catch.
I can't use raise Exception in VB
Here's a tutorial for the Try-Catch exception block you're looking for http://www.dreamincode.net/forums/topic/87751-error-handling-for-beginners-part-two-try-catch/.
Join our real-time social learning platform and learn together with your friends!