Most times when I use x in f(x) I don't want to change x, that could mess things up badly!
Here's how variable changing may be misused with a sub
With function it's clear x wont get messed up:
Here's how variable changing may be misused with a sub
Code: (Select All)
For x = 1 To 10
f x
Print x
Next
Sub f (x)
x = x ^ 2
End SubWith function it's clear x wont get messed up:
Code: (Select All)
For x = 1 To 10
Print f(x)
Next
Function f (x)
f = x ^ 2
End Function
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

