Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why forced to use Function instead of Sub
Message
From
31/12/2004 16:36:11
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Why forced to use Function instead of Sub
Miscellaneous
Thread ID:
00973583
Message ID:
00973583
Views:
63
Whenever I add a new function to a VB.NET code inside my form, I always end up with something like this:
    Private Sub MyFunction()

    End Sub
But, why am I forced to use a function in order to return a value:
    Private Function GetUrl(ByVal tcUrl As String) As String
        Dim lcMergedText As String

        Return lcMergedText
    End Function
This syntax confuses me. I just don't understand why we can't use the Sub approach when returning a value.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform