What is the Difference between a sub and a function?
Answers were Sorted based on User's Feedback
Answer / bhupendran
sub does not return's a value,but function return's value
Is This Answer Correct ? | 36 Yes | 2 No |
Answer / aravindreddy
SUB is a method
FUNCTION is to return a value to it
Is This Answer Correct ? | 29 Yes | 2 No |
Answer / alam
Function always returns a value but sub does not.
Is This Answer Correct ? | 22 Yes | 4 No |
Answer / m. aqueel
Sub keyword is used for the procedures and procedures never
return a value where function key word is used for function
and function returns a value that can be assign to any
variable.
Is This Answer Correct ? | 17 Yes | 1 No |
Answer / aaa
Function returns a value, Sub doesn't.
Function can be called from within a cell, similar to
=Today() function.
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / kinjal
sub does not returns a value but function returns a value
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / bart calixto
yeah, sure.. everyone says that but...
what's the purpose of sub.?
I can do a function
Function ThisIsASub()
write "HELLO WORLD"
end Function
wow! I have a sub now.
so, besides the stupid reason that sub don't return value, what's the point of using subs?
If like someone create a newIF but it doesn't support ELSE... what's the point?
Greetings,
Bart.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / digvijay
Sub is also function but never return the value and Function
must return the value.
Function is user defined and System define but sub is
keyworlds that defined by user.
function can be macro but Sub is Not.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / raju chauhan
Like a Function procedure, a Sub procedure is a separate
procedure that can take arguments, perform a series of
statements, and change the value of its arguments. However,
unlike a Function procedure, which returns a value, a Sub
procedure can't be used in an expression.
Is This Answer Correct ? | 0 Yes | 0 No |
Tell us what is the difference between struct and class?
Explain the main components in .net?
Tell us what is heap and what is stack?
Using activex control in .net?
i had attended to infosys interview on 17th april 2010...on .net..3+ experience for Technology Analyst .. to my knowledge i did well in technical and hr whether i loose the interview or still processing is taking place..am confused please. what accuatly would be happend?
What is the single responsibility principle?
What is the difference between encrypting a password and applying a hashing?
Why did they call it .net?
How to implement CAS in .Net?
Define code access security (cas)?
Please explain what are an inheritance, polymorphism, and encapsulation?
What is assemblies in .net?