0% found this document useful (0 votes)
4 views

Error Types

error types

Uploaded by

2706478
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Error Types

error types

Uploaded by

2706478
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Types of Errors

• Some errors will prevent the code from running at all. These
are referred to as compilation errors because the code cannot
compile to run
• Other errors may cause the code to stop executing once it has
started. These are referred to as runtime errors
• Some errors do not affect code execution but produce the
wrong values of output – Logical Errors
Common Errors
• Common mistakes that result in compilation errors include:
– Unclosed or mis-matched parentheses (brackets)
– Extra or missing end commands
– Incorrect spelling of commands (e.g. For instead of for)
– Incorrect punctuation of commands (e.g. using ; instead of : when
declaring the range of a for loop)
– Unusual syntax – normally from copying code from another source
(PowerPoint; Internet…)
Common Errors
• Common mistakes that result in runtime errors include:
– Incorrect variable type or dimensions for operations e.g. trying to
concatenate matrices where the dimensions don’t match
– Incorrect spelling of variable names (e.g. calling a variable Apple in a
previous line but apple when used)
– Clearing variables incorrectly (e.g. using clear inside a for loop which
also deletes the counter)
– Calling undefined functions or passing functions too many or too few
input arguments

You might also like