Friday 16 September 2011

Function local variables

Module Module1

    Sub F()
        Dim Name As String = "www.java2s.com"
        Dim Price As Double = 17.45
        Dim As Integer = 1001

        Console.WriteLine("In F")
        Console.WriteLine("Name: " & Name)
        Console.WriteLine("Price: " & Price)
        Console.WriteLine("I: " & I)
    End Sub

    Sub FF()
        Dim Name As String = "string"
        Dim Price As Double = 49.99
        Dim As Integer = 0

        Console.WriteLine("In FF")
        Console.WriteLine("Name: " & Name)
        Console.WriteLine("Price: " & Price)
        Console.WriteLine("I: " & I)
    End Sub

    Sub Main()
        F()
        Console.WriteLine()
        FF()
    End Sub

End Module

No comments:

Post a Comment