Microsoft KB Archive/262501

= PRB: eVB: Omitting Certain Optional Parameters for Move Method Gives &quot;Type Mismatch&quot; Error =

Article ID: 262501

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q262501



SYMPTOMS
If you are not supplying certain optional parameters for the Move method of an intrinsic eMbedded Visual Basic control, you may get the error message

An error occurs while running this application : type mismatch

when you run the program.

This problem can also been seen with the same code running in Microsoft Visual Basic 6.0. The error message in this case is:

runtime error 448: named argument not found



CAUSE
This problem happens because you must specify all arguments in the order the syntax requires. In the Visual Basic 6.0 documentation for the Move method, it states:

Only the left argument is required. However, to specify any other arguments, you must specify all arguments that appear in the syntax before the argument you want to specify. For example, you can't specify width without specifying left and top. Any trailing arguments that are unspecified remain unchanged.

This also applies to eMbedded Visual Basic.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a new Pocket PC or HPC Pro project in eMbedded Visual Basic. Form1 is created by default. Add a command button and a text box to Form1.  Paste the following code into Form1: Private Sub Command1_Click On Error Resume Next Text1.Move 100,, , 100 MsgBox Err.Number & vbCrLf & Err.Description End Sub   Run the project and click the command button. The following error message appears:

An error occurs while running this application : type mismatch

This error also occurs if you replace the Text1.Move statement with any of the following lines: Text1.Move 100,, 100 Text1.Move 100,, 100, 100 Text1.Move 100, 100,, 100 

Keywords: kbbug kbprb KB262501

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.