hai..friends ....what is the difference between function and
sub procedure ....here every one know's theoretically here
my question is what is the meaning of function can return
the value and sub can't return the value...can you give one
example with some values for that ....what does it mean ?
how function can return the value...sub can not...any one
please...........with example
Answer Posted / monika
function myfunction(a,b)
myfunction=a+b
End function
returnvalue=myfunction(5,9)
msgbox returnvalue
it will display value returned by function and stored in returnvalue variable as 14
sub myfunction(a,b)
myfunction=a+b
End sub
returnvalue=myfunction(5,9)
msgbox returnvalue
it will throw error as no value returned by sub
sub myfunction(a,b)
c=a+b
msgbox c
End sub
call myfunction(5,9)
it will display 14 inside sub
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Which operator is used to concatenate the 2 values in the vbscript language?
What is the difference between function and procedure?
Explain about tristate constants?
what is used of Property........End Property loop ? how to write the script for it?
regular expression that will recognize a browser as long as its name property starts with mybrowser
What is the difference between a dictionary and an array?
How are values assigned to string type and numeric type variables?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
What is select case statement?
What is the extension of the vbscript file?
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
What is the main difference between function and sub-procedure?
What is the use of the date function in the vbscript language?
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.