Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how to acces the remote mechine using vb cript(QTP)

2033


How will you convert a string to lower case string using vbscript?

1018


How will you get a string with the specified character the specified number of times in vbscript?

1019


Explain about tristate constants?

1023


write a function to read the items from combobox of Flight reservation & save in excel (QTP)??

2857


Which operator can be used to do an xor operation in vbscript?

1254


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

4414


Explain the tristate constants in vbscript?

1036


What is the purpose of folders object of scripting.filesystemobject class in vbscript?

1370


Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..

2447


how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

5212


What is the use of the formatdatetime function in the vbscript language?

1022


How to replace junk code recorded by QTP with a mall function.

2086


What is the difference between for loop and while loop?

1055


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

987