Define function and call it in a Module : Function « Class Module « VB.Net Tutorial






Module Module1

    Sub ShowBookInformation()
        Console.WriteLine("A")
        Console.WriteLine("B")
        Console.WriteLine("C")
        Console.WriteLine("D")
    End Sub

    Sub GreetInEnglish()
        Console.WriteLine("Hello, world")
    End Sub

    Sub GreetInSpanish()
        Console.WriteLine("Hola, mundo")
    End Sub

    Sub ShowTime()
        Console.WriteLine("Current time is: " & Now)
    End Sub

    Sub Main()
        ShowTime()
        GreetInEnglish()
        GreetInSpanish()
        ShowBookInformation()
    End Sub

End Module
Current time is: 11/05/2007 9:29:38 PM
Hello, world
Hola, mundo
A
B
C
D








6.2.Function
6.2.1.Define function in a Module
6.2.2.Pass Double to a function
6.2.3.Calculates the power of a value, defaults to square
6.2.4.Assign function return value to variables
6.2.5.Call function as a statement
6.2.6.Use function in If statement
6.2.7.Function procedure to square a number.
6.2.8.Finds the maximum of three numbers input
6.2.9.Function with string return
6.2.10.Return double type value from Function
6.2.11.Define function and call it in a Module
6.2.12.Functions with different parameter number
6.2.13.Return string type value from function