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 are values assigned to the variables in the vbscript language?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
Explain about tristate constants?
Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.
hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?
how to write validation function for date in vb script
please can you help me to get a code of flames using a visual basic 6
what is the object hyrarchy in QTP for a web based application
How to open browser in vb script?
How do you declare a variable in vbscript?
Mention what is the difference between vbscript and vba?
what is resorceallocation
Which operator can be used to check if two numbers are equal or not in vbscript?
What are class events?
What is the purpose of folders object of scripting.filesystemobject class in vbscript?