Transcript Lecture 04

Lecture 4
Programming
Technique
Programming Appreciation
Finding and Fixing Errors
• Syntax Errors
• Run-Time Errors
• Logic Errors
1- 2
Syntax Error
Double-click anywhere on this line to jump to the error
Syntax Error
1
2
When the compiler
identifies 確定 syntax
errors, it cannot continue.
Click No to return to the
editor and correct the
error.
3
Project Property Page Dialog
• The default startup object if Form1
• Using Project menu, Properties change the
startup object to match the new name
1- 5
Finding and Fixing Errors
• Run-Time Errors
Pass syntax checking but fail to execute.
e.g. divide by zero; square root of a negative number.
• Logic Errors
Project runs but produces Private Sub btnSpanish_Click
incorrect results.
e.g. Incorrect calculation;
End Sub
wrong text appears.
Zero build errors means that you
have a clean compile.
1- 6
Naming Rules: Name Property
• How the programmer refers to a control in
code
• Name must begin with a letter
• Must be less than _________________long
• May include numbers and the underscore (_)
• Use appropriate __ character naming______
e.g. txtName,
lblName
IntelliSense
Automatically pops up to give the programmer help.
Intellisense anticipates your needs during coding and
displays prompts to assist you in coding
1- 8