Some Command Argument Names Not CapitalizedLast reviewed: July 29, 1997Article ID: Q113152 |
The information in this article applies to:
SYMPTOMSIn Microsoft Visual Basic Programming System, Applications Edition, when you edit or run a procedure, command argument names in the procedure may not be capitalized.
CAUSEWhen 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:=truewhen 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:=TrueFileSaveAs 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:=truewhen 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:=truewhen 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:=TrueBecause 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 |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |