Code Block II seems to work just as well as Code Block I. So why not deprecate the use of the "Sub...End Sub" construct in favor of "Function...End Function"? Functions seem to be superior to subs. They can do everthing that a Sub can do in addition to returning a value (and functions don't even have to return a value, if you don't want them to). So why not simplify life and use only functions (in VBScript, anyway)? Any thoughts?
"The poor and the needy - are selfish and greedy"
Morrissey
Code:
'Begin Code Block I
Sub cmdButton1_onClick()
Alert "4 ^ 3 = " & CubeIt(4)
End Sub
'End Code Block I
'Begin Code Block II
Function cmdButton2_onClick()
Alert "5 ^ 3 = " & CubeIt(5)
End Function
'End Code Block II
Function CubeIt(x)
CubeIt = x ^ 3
End Function
"The poor and the needy - are selfish and greedy"
Morrissey