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
How to create a cookie using vbscript?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
What is the use of the recordset object and which statement is used to create such an object?
Which in-built function related to an array joins substrings into one string in the vbscript language?
what is the differance between BYVAL,BYREF?
How will you release the memory acquired by an array variable in vbscript?
how to write validation function for date in vb script
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
Both Static and dynamic arrays are handled by VB script. Is it true?
what is the difference between modular and data and keyword driven framework
Anyone have qtp11.0 crack?
Which in-built function is used to format the number in the vbscript language?
How to take whole text output from screen of Bitmap Application.
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
Mention what are the rules to name variable in vbscript?