[VB.NET]ByValキーワードで値渡しのサンプル
書式
メソッド名(ByVal 変数名)
使用例
Module ModuleTest
Sub Main()
Dim y as Integer = 5
testFunc(y)
Console.WriteLine(y)
End Sub
Sub testFunc(ByVal y)
y = y * 2
Console.WriteLine(y)
End Sub
End Module
実行結果
5
10