Q:

functions in vb.net

Private Function addFunc(ByVal [VarName] As Integer) As [ReturnDataType] 
	[action]
	Return [ReturnVal]
End Function

'Example function
Private Function addFunc(ByVal a As Integer, ByVal b As Integer) As Integer
	Dim sum As Integer
	sum = a + b
	Return sum
End Function

'NOTE: If the keyword “return” is in the code, then it’s a function.
'If not, it’s a subroutine.
1
Function FunctionName [(ParameterList)] As ReturnType
    ' The following statement immediately transfers control back
    ' to the calling code and returns the value of Expression.
    Return Expression
End Function
0

New to Communities?

Join the community