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
Which object is used to work with the database in the vbscript language and what statement is used to create this object?
Explain different types of segment?
How can the spaces from the string be removed?
Mention how to assign a date value to a variable?
What purpose does ‘on error resume next’ serves?
What are the different types of loops available in the vbscript language?
How are comments handled in the vbscript language?
Mention what is the use of option explicit in vbscript?
Which loop is used in case of arrays in the vbscript language?
How will you convert a given number to long in vbscript?
Anyone have qtp11.0 crack?
A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.
who will create the object?
What's the difference between vbscript and vb.net?
Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar