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

Explain few date functions in vbscript?

612


Which date function is used in the vbscript language to find the difference between the 2 dates?

588


How regexp.execute method works?

583


hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?

1546


When to use function procedures and what are its characteristics?

547






1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)

1610


how to operate webobjects in a webpage using getobject function and then using generic methods?

2538


Difference between dim,public and private variables in vb script?

523


How to write VB script for login module?

2673


What are the 2 ways in which a variable can be declared in the vbscript language?

562


what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

1430


Explain a few date functions in vbscript

553


how does vb script help in web page designing? explain with example.

1584


What is the use of the recordset object and which statement is used to create such an object?

527


Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.

1568