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

hai..friends ....what is the difference between function and
sub procedure ....here every one know's theoretically here
my question is what is the meaning of function can return
the value and sub can't return the value...can you give one
example with some values for that ....what does it mean ?
how function can return the value...sub can not...any one
please...........with example

Answer Posted / monika

function myfunction(a,b)
myfunction=a+b
End function

returnvalue=myfunction(5,9)
msgbox returnvalue

it will display value returned by function and stored in returnvalue variable as 14

sub myfunction(a,b)
myfunction=a+b
End sub

returnvalue=myfunction(5,9)
msgbox returnvalue

it will throw error as no value returned by sub

sub myfunction(a,b)
c=a+b
msgbox c
End sub

call myfunction(5,9)

it will display 14 inside sub

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a cookie using vbscript?

1204


In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

2476


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

977


Which in-built function related to an array joins substrings into one string in the vbscript language?

955


what is the differance between BYVAL,BYREF?

2268


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

1230


how to write validation function for date in vb script

2623


if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.

1838


Both Static and dynamic arrays are handled by VB script. Is it true?

1086


what is the difference between modular and data and keyword driven framework

2261


Anyone have qtp11.0 crack?

2831


Which in-built function is used to format the number in the vbscript language?

1017


How to take whole text output from screen of Bitmap Application.

2371


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

2062


Mention what are the rules to name variable in vbscript?

1024