• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

VB Equivalent to C# 'ref' Parameters

C# VB
public void refParamMethod(ref int i)
{
    i = 1;
}

public void callRefParamMethod()
{
    int i = 0;
    refParamMethod(ref i); //'ref' keyword required in the call
}
Public Sub refParamMethod(ByRef i As Integer)
    i = 1
End Sub

Public Sub callRefParamMethod()
    Dim i As Integer = 0
    refParamMethod(i) 'no keyword required in the method call
End Sub


Use Instant VB to convert from C# to VB.NET.     


Copyright © 1997 – 2017 Tangible Software Solutions Inc.