thanks
thank you for valuable information
Mohammed-Iraq
[Modifiers] Sub SubName [(ParameterList)] [Statement] End Sub• Modifiers – used to access level of the procedure; example: Public, Private, protected, Friend, Protected Friend and information regarding overloading, Overriding, Sharing and Shadowing. • SubName – it used to indicate the name of a subroutine. • ParameterList – the specified list of parameters. Example: This example will do the addition of the two values inside the sub and the output will be displayed when the sub is called from different sub. And here’s the following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'call the sub AddtwoValues AddtwoValues() End Sub 'creata a sub Sub AddtwoValues() 'some declaration Dim num1 As Integer = 5 Dim num2 As Integer = 7 Dim total As Integer 'do the computation total = num1 + num2 'display the result End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'call the sub AddtwoValues 'using the two value parameter AddtwoValues(23, 45) End Sub 'creata a sub with parameters Sub AddtwoValues(ByVal num1 As Integer, ByVal num2 As Integer) 'some declaration Dim total As Integer 'do the computation total = num1 + num2 'display the result End Sub