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
give me any information abou vb script books learn quckly
What is the scope of a constant declared using public?
Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.
Which function allows you to instantiate an object given its programmatic identifier or progid?
If else for do while select in vb script?
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?
what is the use of QCUtil? explain with one example?
What are the data types supported by vbscript?
How strcomp function works?
What are the special sub-types in vbscript?
What are the 2 ways in which a variable can be declared in the vbscript language?
Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
How will you get a subset of a array in vbscript?
what is diff between static and dynaic arrys?
who will create the object?