Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Dim b As Boolean 'b is already initialised to False
bool b = false;
ByOut
ByVal
ByRef
ref
out
GetNumber
Public Sub VBStyle() Dim i As Int32 i = GetANumber() End Sub Public Sub CsStyle() Dim i As Int32 = 0 i = GetANumber() End Sub
.method public instance void VBStyle() cil managed{ // Code size 8 (0x8) .maxstack 1 .locals init ([0] int32 i) IL_0000: ldarg.0 IL_0001: callvirt instance int32 VBWinApp.Class3::GetANumber() IL_0006: stloc.0 IL_0007: ret} // end of method Class3::VBStyle.method public instance void CsStyle() cil managed{ // Code size 10 (0xa) .maxstack 1 .locals init ([0] int32 i) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: ldarg.0 IL_0003: callvirt instance int32 VBWinApp.Class3::GetANumber() IL_0008: stloc.0 IL_0009: ret} // end of method Class3::CsStyle
call
callvirt