fork(1) download
  1. Imports System
  2.  
  3. Public Class Test
  4. Public Shared Sub Main()
  5. Dim sLetras() As String = {"a", "b", "c", "d"}
  6. Dim sNuevaLetra As String
  7. Dim iPosicion As Integer
  8. Try
  9. Console.WriteLine("Introducir una letra")
  10. sNuevaLetra = "F"
  11. iPosicion = 4
  12. sLetras(iPosicion) = sNuevaLetra
  13. Console.WriteLine("Se ha modificado la letra del array")
  14. Catch oExcep As System.InvalidCastException
  15. Console.WriteLine("*******")
  16.  
  17. Console.WriteLine(oExcep.ToString())
  18. Console.WriteLine("*******")
  19.  
  20.  
  21. end try
  22. End Sub
  23. End Class
Runtime error #stdin #stdout #stderr 0.09s 16168KB
stdin
Standard input is empty
stdout
Introducir una letra
stderr
Unhandled Exception: System.IndexOutOfRangeException: Array index is out of range.
  at (wrapper stelemref) object:stelemref (object,intptr,object)
  at Test.Main () [0x00000]