Question:
How can I work with a function in E3 scripts?
Solution:
To do so, you must set the function with the structure:
Function Name(parameter1, parameter2,.., parameterN)
script
End function
script
End function
Example:
Sub CommandButton1_Click()
‘Sums the values by using the Sum function
result = Sum(10, 20)
MsgBox result
End Sub
‘*****************************************************
‘Function’s declaration
Function Sum(a, b)
Sum = a + b
End Function
‘Sums the values by using the Sum function
result = Sum(10, 20)
MsgBox result
End Sub
‘*****************************************************
‘Function’s declaration
Function Sum(a, b)
Sum = a + b
End Function
‘Sub Empty just to keep the structure
Sub Empty_Sub()
End Sub