The code does not compile on my system, v. 2.5.5. It does not, in this case, give the exception, only the errors listed below. That exception still occurs when the function "findType(byval type as byte) as byte" is added into one of my modules.
However, the following does compile correctly.
Code: Select all
Dim b as Byte
Sub Main()
b = findType(3)
End Sub
function findType(byval type1 as byte) as byte
findType = type1
end function
If "type" is used instead of "type1", the output is:
Code: Select all
testAccessError.bas:5: Error: function "findType" takes no parameters
testAccessError.bas:8: Error: expected '(' following function name
testAccessError.bas:9: Error: expected Sub, Function, Const, Declare, Dim or Enum
testAccessError.bas:10: Error: expected Sub, Function, Const, Declare, Dim or Enum