Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Incr(ByVal x As Integer)
- x += 1
- Console.WriteLine("Dentro Incr, x vale {0}", x)
- End Sub
- Sub IncrR(ByRef x As Integer)
- x += 1
- Console.WriteLine("Dentro IncrR, x vale {0}", x)
- End Sub
- Class MyInt
- Public Property Value As Integer
- End Class
- Sub Incr(x As MyInt)
- x.Value += 1
- Console.WriteLine("Dentro incr, Value vale {0}", x.Value)
- End Sub
- Sub Main()
- Dim y As Integer = 10
- Console.WriteLine("Prima di chiamare Incr, y vale {0}", y)
- Incr(y)
- Console.WriteLine("Dopo la chiamata a Incr, y vale {0}", y)
- IncrR(y)
- Console.WriteLine("Dopo la chiamata a IncrR, y vale {0}", y)
- Dim a As New MyInt With {.Value = 10}
- Console.WriteLine("Prima di incr, Value vale {0}", a.Value)
- Incr(a)
- Console.WriteLine("dopo incr, Value vale {0}", a.Value)
- Console.ReadLine()
- End Sub
- End Module
Add Comment
Please, Sign In to add comment