How can we return a value from User Defined Function ?
For Eg. we have 2 functions. In Fun1 i am getting 2 values
(a,b) and i am addding those 2 and storing in to another var
(c). Now i want to pass that var(c) to another function
(fun2). What will be the script?
Answer Posted / siri
'vbscript
'create two functions
dim a,b,d
a=20,b=30
dim c
d=add(a,b)
msgbox d
call subtract(d)
function add(a,b)
dim c
c=a+b
add=c 'add is the function name:this statetment can
return c value
end function
function subtract(c)
dim f,e
f=20
e=d-c
msgbox e
End function
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
how to acces the remote mechine using vb cript(QTP)
How will you convert a string to lower case string using vbscript?
How will you get a string with the specified character the specified number of times in vbscript?
Explain about tristate constants?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
Which operator can be used to do an xor operation in vbscript?
How to Convert Hex color code to color name in VB Script?
Explain the tristate constants in vbscript?
What is the purpose of folders object of scripting.filesystemobject class in vbscript?
Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..
how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.
What is the use of the formatdatetime function in the vbscript language?
How to replace junk code recorded by QTP with a mall function.
What is the difference between for loop and while loop?
What methods are used to create text files and open text files in the vbscript language?