Some Command Argument Names Not Capitalized

Last reviewed: July 29, 1997
Article ID: Q113152
The information in this article applies to:
  • Microsoft Visual Basic Programming System, Applications Edition, version 1.0

SYMPTOMS

In Microsoft Visual Basic Programming System, Applications Edition, when you edit or run a procedure, command argument names in the procedure may not be capitalized.

CAUSE

When you edit or run a procedure in a Visual Basic, Applications Edition module, all built-in commands and some argument names are automatically capitalized to make it easier to read your code. Built-in command argument names and identifier names appear with the capitalization you used when you typed them, unless they happen to be the same as a command name (in which case, they are capitalized the same way as the command) or you typed them with different capitalization previously in the same procedure (in which case, the previous capitalization is used).

For example, if you enter the following line of code in a Visual Basic module

   filesaveas format:=2, name:="Test", backup:=true

when you press ENTER with the insertion point at the end of this line, or run the procedure that contains the command, the command appears as follows:

   FileSaveAs format:=2, Name:="Test", backup:=True

FileSaveAs is capitalized because it is a built-in command. Because "format" and "backup" are not built-commands, they are not capitalized. Name is a built-in command, although it is an argument name in this example, so it is capitalized. True is a built-in value so it is capitalized.

If you then change the above line of code to the following

   FileSaveAs format:=2, Name:="Test", BaCKup:=true

when you press ENTER with the insertion point at the end of this line or run the procedure that contains the command, the command appears as you typed it. Because "backup" is not a built-in command, it retains the capitalization you give it.

If you then enter a new line of code in the same procedure using the same parameters as follows

   filesaveas format:=2, name:="Test2", backup:=true

when you press ENTER with the insertion point at the end of this line or run the procedure that contains the command, the command appears as follows:

   FileSaveAs format:=2, Name:="Test2", BaCKup:=True

Because you have previously used the "backup" argument in the procedure, it is capitalized the same as the first instance you typed in the procedure (BaCKup) even though "backup" is not a built-in command.
Keywords          : kbcode kbprg
Version           : 1.00
Platform          : WINDOWS


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.