|
|
![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
Control Prefixes The suggested Microsoft control prefixes appear in Table 1.5. As you can see, theres a suggested prefix for every standard type of control.
If you work with databases, take a look at Table 1.6, which holds the prefixes for Data Access Objects (DAO).
Besides the prefixes in Table 1.6, Microsoft recommends prefixes for menus and constants as well, and well take a look at these now to round off our discussion on this topic. Menu And Constant Prefixes Microsoft recommends that you prefix menu controls with mnu and then the menu name followed by the menu item name. For example, the File menus Open item would be named mnuFileOpen, and the Edit menus Cut item would be named mnuEditCut. Microsoft also recommends that constant names (you declare constants with the Const statement) should be mixed case with capitals starting each word, for example: Const DiskDriveNumber = 1 'Constant Const MaximumFileCount = 1024 'Constant
That completes the prefix and naming conventions. As you can see, there are prefixes for just about every type of programming construct available. Youre not constrained to use them, but if you work in a team, they can be extremely helpful. Microsoft also has a set of suggestions on commenting your code, and well take a look at those suggestions now. Code Commenting ConventionsIn general, you should add a new comment when you declare a new and important variable, or wish to make clear some implementation method. Ideally, procedures should only have one purpose and be named clearly enough so that excessive comments are not required. In addition, procedures should begin with a comment describing what the procedure does, and that comment should be broken up into various sections. The Microsoft recommendations for those sections appear in Table 1.7; note that not all sections may be applicable for all procedures.
|
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |