ajtsystems
IS-IT--Management
My script is fairly simple but I cant seem to get the functions return value out
Dim retValue
' Call the function with and without the Call keyword.
Call ShowSum(3, 4)
ShowSum 5, 6
retValue = ShowSum(7, 8)
MsgBox "The function returned: " & retValue
Function ShowSum(value1, value2)
Dim sum
' Determine and display the sum.
sum = value1 + value2
MsgBox "The sum is: " & sum
' Set the function's return value.
ShowSum = sum
End Function
wscript.echo sum
Dim retValue
' Call the function with and without the Call keyword.
Call ShowSum(3, 4)
ShowSum 5, 6
retValue = ShowSum(7, 8)
MsgBox "The function returned: " & retValue
Function ShowSum(value1, value2)
Dim sum
' Determine and display the sum.
sum = value1 + value2
MsgBox "The sum is: " & sum
' Set the function's return value.
ShowSum = sum
End Function
wscript.echo sum