English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

procedure and function are the subrountine which do some functionly based on the code you have inside it.

The main differecence betwen procedure and function is that procedure doesn't return anything calling subroutine , but where the function will return the value to the subroutine

For Example

function aa(Integer a, Integer b)
{
Integer c;
c=a+b;
return c;
}
sub bb(Integer a, Integer b)
{
integer c;
c=a+b;
// The value of the c will be displayed here itself. It won't return any values to calling subroutine.
msgbox (c);
}

Calling sub routine
private sub command1_click()
{

Integer subAB= aa(10,20) // calling the function will return the calculated result from the function to variable subAB.
alert(subAB) // the value should be 30.
}

Does it make sense ?...

2007-03-18 18:12:36 · answer #1 · answered by B Rajagopal 1 · 0 0

They're mostly the same, but a function returns a value and a sub does not (like a void function in C).

2007-03-19 01:09:06 · answer #2 · answered by undercoloteal 3 · 0 0

fedest.com, questions and answers