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

Explain How do you create a recordset object in vbscript?

974


What are the disadvantages of vbscript?

1185


Explain the asc function?

884


Write a code to print numbers from 5 to 0?

1091


Compare java script and vb script?

1035


what is diff between static and dynaic arrys?

2092


Explain about the support of asp for vb script functionality?

900


How can constants be declared in the vbscript language?

953


What is the event handling in vbscript?

943


When are redim statement and preserve keyword used in the vbscript language?

996


Which function allows you to instantiate an object given its programmatic identifier or progid?

995


1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

3986


Mention what is vbscript?

1062


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

2086


Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.

2031