You Cannot Return a Value Because this Method has No Defined Return Type Error

You can't use the Return statement with a variable, expression, or value to be returned in a method unless you define a data type for the value being returned in the function declaration.

# Example

No return data type defined in the method declaration:

Sub myMethod(a as Integer, b as Integer)
Return a*b

To return a value, declare the data type of the returned value. In that case, the declaration statement in this example would be:

Function myMethod(a as Integer, b as Integer) as Integer

# See Also

, Function, Return, Sub statements.