C
Colin Mc Mahon
Hi all,
First off I know the difference between functions and subs, basically a
function returns a value on execution of a code block wheras a sub just
executes a code block (more or less).
I have found however that if I 'call' a function in the same way as I would
a sub the function executes the code as if it were a sub ie:
Call openDB 'this is a function which creates a connection object to
my database called dbConn which is the available to the rest of my code.
openDB is most definitely a function and this method of calling it works
perfectly well.
My questions are thus:
1) Am I just ignorant of calling procedures?
2) Is it a good idea to call functions like this, or should a sub be a sub
and a function be a function?
3) If not a good idea then why not?
Any links or thoughts on this 'problem' would be highly appreciated.
Colin Mc mahon
First off I know the difference between functions and subs, basically a
function returns a value on execution of a code block wheras a sub just
executes a code block (more or less).
I have found however that if I 'call' a function in the same way as I would
a sub the function executes the code as if it were a sub ie:
Call openDB 'this is a function which creates a connection object to
my database called dbConn which is the available to the rest of my code.
openDB is most definitely a function and this method of calling it works
perfectly well.
My questions are thus:
1) Am I just ignorant of calling procedures?
2) Is it a good idea to call functions like this, or should a sub be a sub
and a function be a function?
3) If not a good idea then why not?
Any links or thoughts on this 'problem' would be highly appreciated.
Colin Mc mahon