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
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

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

957


How to get the length of the string by making use of the string function?

1077


Mention what is vbscript procedures?

995


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

1055


What are the environments supported by vbscript language?

924


How to add actions in driver script to run those actions in QTP?

1941


How to capture a runtime error in vbscript?

1150


what is the features of visual basic?

2139


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

997


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

1005


Explain vbscript in detail?

1052


Can u describe what kind of testing are for OTC derivates by banks.

2127


How are values assigned to string type and numeric type variables?

995


How do you declare a variable in vbscript?

1058


Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).

1914