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
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
What is the difference between a dictionary and an array?
what is resorceallocation
Dear All, I am geting below IE error whilie executing the QTP scripts in Batch mode "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." can any one suggest me how to resolve this issue . Thanks Balaji
Which loop is used in case of arrays in the vbscript language?
What is the difference between vbscript and vba?
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
Mention how to assign a date value to a variable?
did any one attended interview in applabs if you had gone through plz tell me the procedure
Is vbscript a case-sensitive or case-insensitive?
how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me
What are the properties of regexp object?
What is the main difference between function and sub-procedure?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
How can you fetch the value of a cookie?