06-03-2009, 12:24 PM
[/align]Using the Insert->Function Definition Generator i created a new function mysum with two variables var1 and var2 (both having passmode = By value)
I want this function to add the 2 variables and return the sum to the calling test.
code for the function:
TestCode:
Result:
I get a Type mismatch error. I tried all combinations of function definitions like: e.g. int Public Function mysum(var1, var2) but i still get the type mismatch error.
I want this function to add the 2 variables and return the sum to the calling test.
code for the function:
Code:
Public Function mysum(var1, var2)
' TODO: add function body here
sum=var1+var2
msgbox(var1 & "+" & var2 & "=" & sum)
return(sum)
End Function
TestCode:
Code:
sum=mysum(1,2)
Reporter.ReportEvent micPass, "ReportStepName Pass", "Sum=" &sum
Result:
I get a Type mismatch error. I tried all combinations of function definitions like: e.g. int Public Function mysum(var1, var2) but i still get the type mismatch error.