Difference between a sub and a function?
Answers were Sorted based on User's Feedback
Answer / m.sivakumar
A Sub Procedure is a method will not return a value
A sub procedure will be defined with a Sub keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine (My name is: & myName)
End Sub
A function is a method that will return value(s).
A function will be defined with a Function keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer)
As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
Is This Answer Correct ? | 21 Yes | 2 No |
Answer / satishdubey
A Sub Procedure is a method will not return a value
A sub procedure will be defined with a Sub keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine (My name is: & myName)
End Sub
A function is a method that will return value(s).
A function will be defined with a Function keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As
Integer)
As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
Is This Answer Correct ? | 7 Yes | 4 No |
I want to reduce my CPU Usage when I am querying the Database for records. Now my Winform App(in VB.Net) suddenly Jumps to 100% CPU Usage when i query for records from sql server database. I want this Usage to be less. Any help is appreciated
Which dll is used for microsoft .net run time?
What are the similarities between class and structure?
Define serialization in .net?
Explain the difference between value and reference types?
What are nested classes?
Allowed program to auto-correct the database when loading a presentation.
hello dear friends my problem is that i want to save images that is pictures in SQL server using vb.net can any body help me to do so please
What is VB.Net?
is it possible to use flexgrid in vb dotnet?
9 Answers Banking, Microsoft, NetBIOS,
what are the advantage in vb.net and different between vb and vb.net
6 Answers Data Entry Operator, Infosys, TCS, Zansa,
How to create a constant in vb.net?