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



hai..friends ....what is the difference between function and sub procedure ....here every one know&..

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

More VB Script Interview Questions

How to check the particular window is exist or not with out using check points

2 Answers  


How to access array data?

0 Answers  


How to write functions and sub in vb script?

0 Answers  


Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com

1 Answers  


write a vbscrpit to swap values

2 Answers   Adani,


Explain what is loose binding? Why is it not a good practice to use it?

0 Answers  


what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com

4 Answers   TCS,


How to write VB Script for selecting a particular row in a WebTable?

1 Answers   Patni,


What are the naming conventions while declaring a variable in the vbscript language?

0 Answers  


i need to sort the data using qtp script for this how i need to write a qtp script

0 Answers  


Create a file system object to do the following i. Create a folder ii. Create a text file in the folder iii. Update text file with some tex

2 Answers  


How to return a value from function...? you should not tell msgbox, print.. etc.,

6 Answers  


Categories