What is the difference between a Sub and a Function?

Answers were Sorted based on User's Feedback



What is the difference between a Sub and a Function?..

Answer / suresh

Sub won?t return values
Fuction return values

Correct me If i was Wrong..

Is This Answer Correct ?    28 Yes 3 No

What is the difference between a Sub and a Function?..

Answer / mukesh

A function accepts any number of parameters (possibly
zero), does something with them, and returns a value.
A subroutine is performs an action, but doesn't return a
value.

There are two differences between a function and a
subroutine:
A)How they are invoked. B)How they are accessed.

A function call has the following syntax ::function (arg1,
arg2, ...)
where: function -->Is the name of the function. arg1,
arg2, ... Are the arguments.

A subroutine call has the following syntax ::subroutine
(arg1, arg2, ... {outputfield|'format'})
where: subroutine -->Is the name of the subroutine. arg1,
arg2, ... Are the arguments.
{outputfield|'format'} Is the name of the output field or
its format.

In addition, on some platforms, the functions are available
immediately; whereas, the subroutines are available in a
special subroutine library that you must access.

Is This Answer Correct ?    17 Yes 4 No

What is the difference between a Sub and a Function?..

Answer / sneha wankhede

Sub won?t return values
Fuction return values

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

How would you create Visual basic Document file?

0 Answers  


How can Visual Basic be used for server-side scripting?

0 Answers  


What is vbs file?

0 Answers  


how can i connect the samble database that comes with vb-6 (biblio.mdb) to a datagrid using code? ie what code i have to put in load event

1 Answers  


What is the difference between a property a method and an event? Give an example of each.

18 Answers   Microsoft,






What kind of components can you use as DCOM servers?

1 Answers   Hudson,


what is single thread and multithread apartments model?

2 Answers   Ford,


___ Property is to compress a image in image control.

1 Answers  


Wat is d diff b/w API fns & Norm fns

5 Answers   TATA,


How do you change the icon and otherwise manipulate the DOS box?

0 Answers  


What is Vlookup introduction and formula?

2 Answers  


What is OLEDB?

0 Answers  


Categories