Argument does not match forward declaration: <argument name>

You declared a function or sub with a Declare statement and then defined it with a Function or Substatement. Either of the following conditions could have caused the error:

  • The data type of the indicated parameter in the procedure definition is different from the corresponding parameter in the procedure declaration. For example:
    Declare Sub MySub(X As Integer)
    ' ...
    Sub MySub(X As Double)  ' Illegal because X was previously
    ' ...                   ' declared to be of type Integer
    End Sub

    Change the data type of the indicated parameter in the declaration or the definition of the procedure so that they match.

  • The data type of the indicated parameter matches the data type of the corresponding parameter in the procedure declaration, but the parameters represent different kinds of data structure. For example:
    Declare Function MyFunction(X() As Integer) As Integer
    ' ...
    Function MyFunction(X As Integer) As Integer	' Illegal because X is a
    ' ...	                                        ' scalar variable but
                                                  ' X() is an array
    End Function

    Change the parameter specification in the declaration or the definition of the procedure so that the two match.