Friday, July 4, 2014

VB.NET CODE OF EXCEPTION HANDLING

Module Module1
    Sub Main()
        Dim index As Integer
        Dim val As Integer = 30
        Dim a(5) As Integer
        Try
            index = Convert.ToInt32("abcd")
            a(index) = val
            Console.Write("Value in Range")

        Catch e As FormatException
            Console.Write("BAD FORMAT")


        Catch e As IndexOutOfRangeException
            Console.Write("Index Out OF Bound")

        End Try
 End Sub
End Module
output
Bad Format

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions!

Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions! :  1) What is digital citizenship? 2) What is a digital citi...