Type Mismatch

From Xojo Documentation

Error message

Occurs when you try to pass a parameter of an incorrect data type to a method or function or use an incorrect data type in an assignment statement. The second line of the error message tells you the data type that expected and the data type that was received.


Examples

Trying to assign a string to an Integer variable:

Dim n as Integer
n="Anthony"


The second line of the error message says, "Expected Int32 but got String."

Trying to assign a value to an array instead of an element of the array.

Dim truth(3) as Boolean
truth=True  //must have a subscript


The second line of the error message says, "Expected Boolean() but got Boolean."