Microsoft KB Archive/93672

= Using INPUT With Variable That Has Property Name Changes Code =

PSS ID Number: 93672

Article Last Modified on 1/9/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q93672



SYMPTOMS
Using the INPUT or INPUT # statement with a variable that has the same name as a property changes your source code which can hang the environment or result in an &quot;Invalid Use of Object&quot; error message.



STATUS
Microsoft has confirmed this to be a bug in the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The INPUT and INPUT # statements input data from a file or keyboard into a variable. However, when the environment unexpectedly encounters a property name instead of a variable name to store the data in, it will change your program's source code. This will produce the error message &quot;Invalid Use of Object.&quot; This behavior does not occur in a compiled program. The compiler properly flags the error with an &quot;Variable required&quot; error message.

The following steps can be used to reproduce this problem:

 Start VBDOS.EXE. From the File menu select New Form... (Form1.Frm). Form1 will be created by default. Exit the Form Designer, save all changes.  Add the following code to the Form_Click event procedure of Form1: SUB Form_Click INPUT #1, BACKCOLOR END SUB  Press F5 to run the application. Notice that the INPUT # statement will change to &quot;#1READ BACKCOLOR&quot; and you will get an &quot;Invalid Use of Object&quot; error message or the environment will hang. Press F5 again and the code will change to &quot;MID$(BACKCOLOR,, )= #1&quot; and you will get another &quot;Invalid Use of Object&quot; error message or the environment will hang.</li></ol>

Additional query words: VBmsdos BUGLIST1.00 1.00

Keywords: KB93672

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.