Spring Term, 2005
BA 272 - BUSINESS APPLICATION DEVELOPMENT

Visual Basic

Suggested Standards

to accompany the Project Evaluation Sheet

1.   Project Performance

a)   Project works according to specifications.

·        Your project must follow the requirements outlined in the textbook assignment as well as any additional requirements assigned by your instructor.

b)   Output is accurate.

·        It is not enough to just produce output (displayed or printed).  Your output must be complete and 100 percent accurate.

c)   Logic is efficient.

·        Use the most efficient logic that the textbook or your instructor has covered.

Examples:

Declare and use appropriate variables for calculations.

Use With/End With rather than repeat an object name.

Use Select Case rather than If…Then…Else when appropriate.

d)   Meets all requirements.

·        Follow any special rules and requirements of your instructor.

2.   Program folder

a)   Folder contains all necessary project files ( and no extra files).

·        Create a folder on diskette specifically for this project.  The folder must contain all of the project’s files.  Files unrelated to the project should be moved or deleted.

a)     Folder name starts with your 3 initials followed by the lab ID#.

b)     Project runs as submitted.

·        Make sure that the project loads and runs from the diskette file that you copy to the dropbox. Problems can occur when any of the project’s files are not stored in the project’s folder.  If your project cannot locate a form file, a picture file, a data file, or any other associated file, your project will not run!

·        Test the project; make sure to test it on a computer other than the one on which you wrote it.

3.   User Interface

a)   Professional appearance.

·        Designing the user interface is a critical component in the project’s construction.  Anything that will appear on the screen for the user (forms, message boxes, etc.) must be presented in a professional format.  The screen design should be easy to understand and “comfortable” for the user.

·        Use correct spelling and punctuation.

·        Name the form and set its Text  property (the Text property appears in the form’s title bar).

·        Set the location on the screen for your form to appear.

·        Make sure that any text on the form displays completely, during both design time and run-time.

b)   Follows Windows standards.

·        Follow industry standards in relation to color, size, and placement of controls.

c)   Keyboard access keys (& in Text, Default and Cancel Set).

·        Provide keyboard access keys for all command buttons, menus, and menu options. For some assignments, you will also be required to include access keys for text boxes, option buttons, and check boxes.

·        Follow industry standards whenever possible; use the X of Exit, and the S of Save.

·        Do not give two controls the same access key.

·        Set one command button as the Default button (it will respond when the user presses the Enter key), and set one command button as the Cancel button (it will respond when the user presses the ESC key).  Be aware that some users are accustomed to pressing the Enter key instead of using the Tab key to jump to the next field.

d)   Tab order is correct.

·        Make sure the focus is on the correct object when a form displays.  The tab order must proceed correctly when the user presses the Tab key.

4.   Standards and conventions

a)   Object names.

·        Do not keep the default names assigned by Visual Basic, such as btn1 and lbl3. The exception to this rule is for labels that never change during project execution.  These labels usually hold items such as titles, instructions, and labels for other controls.

·        Use good, consistent names for objects.

·        Begin object names with the correct prefix, in lowercase.

·        Object names with multiple words should have the first character of each word capitalized.  Examples: lblSalesTax and txtLastName.

·        Do not name your objects with numbers.

·         Object names must begin with a letter and can be up to 40 characters in length.  The name can contain letters, digits, and underscores.  An object name cannot include a space or punctuation mark.

As a general rule, don't abbreviate. If you wish to abbreviate very long names, you may do so. But use long enough names to be

easily understandable and be consistent.

b)   Identifiers for Variables and Named Constants.

·        Follow the textbook's standards and conventions when naming (identifying) your variables and constants.

·        Variables: Begin each identifier with a lowercase prefix that identifies the data type. Begin each word of the name with an uppercase character. Examples: intCounter, strFirstName, curPaymentAmount.

·        Constants: Begin identifiers with a lowercase prefix that identifies the data type. 

·        Identifiers for variables and named constants must be 1 to 255 characters in length.  They may consist of letters, digits, and underscores.  They cannot contain any spaces, dashes, or be reserved words.  Reserved words are words to which Basic has assigned some meaning, such as print, name, and value.

c)      c)   Option Explicit / All variables declared.

·         Make sure the Option Explicit statement appears in the General Declarations section of each form or module.

·        Declare local variables and constants at the top of a sub procedure, below the remarks.

·        Declare only module level variables and constants in the General Declarations section.

·        Declare only global variables and constants in a standard code module.

d)     Option Strict / Controlled type conversion required.

·         Make sure the Option Strict statement appears at the top of each form or module.

e)   Remarks in General Declarations section

·        Include the following information in every form in a project and the standard code module:

      Programmer name

              Project number

              Date

              Program description

·        Write remarks describing the purpose of the procedure at the top of every sub procedure and function procedure.

·        Use correct spelling and punctuation in all remarks.

f)    Proper indentation.

·        Follow the textbook coding conventions and indent all lines in sub procedures and sub functions.

·        Do not indent the lines in the General Declarations section of a form or standard code module.

·        Indent all lines inside If/Then/Else, With/End With, For/Next, For/Each, Do/Loop, Select Case, Type/End Type, for readability.

            Examples:

                           If txtName.Text <> "" Then

                                 lblMessage.Text = "Hello there, " & txtName.Text

                           Else

                                 lblMessage.Text = "Tell me who you are."

                           End If

 

                           With txtTitle

                                 .Text = "Big Title"

                                 .Font.Bold = True

                                 .Forecolor = vbBlue

                           End With

 

                           For intCounter = 1 to 10

                                 Printer.Print "Line number " & intCounter

                                 If intCounter = 5 Then

                                       Printer.NewPage

                                 End If

                           Next intCounter

g)   Proper blank lines.

·        Insert one blank line after the remarks at the top of each procedure.

·        Insert one blank line after the declarations for variables and constants.

·        Insert one blank line between procedures.

h)   No unused procedures included.

·        Clean up!  Delete any procedures that do not contain code.