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
What purpose does ‘on error resume next’ serves?
What is the difference between a dictionary and an array?
How to open a file. What is the perpose of true and false mode there?
Anyone have qtp11.0 crack?
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
Explain the support of asp for vb script functionality?
There are 5 web pages.write a script to click the button on 4th web page.
Explain vbscript in detail?
How to Import data from a file (file is on the desktop) to the data table
How do i automate a website www.flyashx.com without having any test cases witin a week time.
Mention the environments where vbscript could be run?
Explain the asc function?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
what types of bugs will we find out in banking projects for automation testing?
Which command is used for writing text on a page?