|
-
May 2nd, 2001, 10:41 AM
#1
Thread Starter
Lively Member
what's the difference between a sub and a function?
what the diffrence between when you write a sub and you write
a function? and what's the difference between if you use "Declare"
to write a function?
[Etc. Private Sub 1234()
and
Private Function 1234()]
"Don't imitate, Innovate!"
-
May 2nd, 2001, 10:55 AM
#2
Take a look at this thread.
-
May 2nd, 2001, 11:00 AM
#3
Fanatic Member
-
May 2nd, 2001, 11:00 AM
#4
Fanatic Member
A Sub (Sub-Rountine) contains a set of procedures that perform an action without returning a Value.
A Function is as above, but returns a value
e.g.
[Code]Public Function MySum(iAddMe as Integer) as Integer
MySum = iAddMe + 100
Exit Function
This can be called from another function or sub like so:
iTotal = MySum(iTotal) (which adds 100 to iTotal)
Declare Function is used when using function from external libraries like dlls. See www.vbapi.com for deatils...
-
May 2nd, 2001, 11:07 AM
#5
Thread Starter
Lively Member
that was the dumbest i ever posted...
i have used Sub and Functions before, i just never
knew ho to define it...
"Don't imitate, Innovate!"
-
May 2nd, 2001, 12:16 PM
#6
what the diffrence between when you write a sub and you write
a function? and what's the difference between if you use "Declare"
to write a function?
[Etc. Private Sub 1234()
and
Private Function 1234()]
Captain's log: Additional.
Mr. Spock has notified me that neither Subs nor Functions can be named with a number as the first letter!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|