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
dim a:a=20
dim b:b=30
dim d
d=add(a,b)
call subtract(d)

function add(a,b)
dim c
c=a+b
add=c
end function
function subtract(d)
dim f:f=10
dim e
e=d-f
msgbox e
end function

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which operator is used to concatenate the 2 values in the vbscript language?

777


How to Convert Hex color code to color name in VB Script?

4155


What methods are used to create text files and open text files in the vbscript language?

737


wht must be the interview question on corinthian information technology solutions incorporated.

2388


how to automatically update the sql server2005 database records when insert in vb6?

1691


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

748


What are the 2 ways to pass a value to the function?

712


How will you get the exponent of the given number in vbscript?

767


What is the technology used by vb script?

727


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

2085


Mention how to access array data?

692


how to comvert 120 into one hunderd twenty rupees only and vice varsa

2013


How can you create an object in vbscript?

822


What are the data types supported by vbscript?

793


what is the standards used for writing the script in QTP

2075