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
What are keywords in the vbscript language?
i need to sort the data using qtp script for this how i need to write a qtp script
In what way program "hello world" you can write in vbscript?
How to add actions in driver script to run those actions in QTP?
How to capture a runtime error in vbscript?
What is vbscript procedures?
How should i Create Email invite with server-side Coding?
How to write VB script for login module?
Which function is used to perform string comparison?
Explain about .wsf files?
How will you get a combined string from array of string in vbscript?
Mention what if you do not specify anything when you call a procedure?
How will you get a string with the specified character the specified number of times in vbscript?
What is the difference between VBScript and JavaScript?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks