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

Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

2585


hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz

2580


give me any information abou vb script books learn quckly

1657


How will you release the memory acquired by an array variable in vbscript?

742


what is the use of QCUtil? explain with one example?

6318






How to Import data from a file (file is on the desktop) to the data table

1554


what is the differance between BYVAL,BYREF?

1766


How strcomp function works?

621


What if you do not specify anything when you call a procedure?

530


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

794


What are the environments supported by vbscript language?

502


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2502


Explain the asc function?

505


Explain the functionality of vbscript?

538


How can constants be declared in the vbscript language?

551