This Season
 

What is a Syntax Error in a Computer Program?

One of the essential concepts any computer programmer must understand is the syntax error. Universal to all programming languages, a syntax error is a common error message and gives you important clues on how to correct your code.

Related Searches:
    1. Syntax

      • Computer programming uses a set of reserved words, or commands, as well as a set of symbols (like curly braces, semicolons, and mathematical operators such as plus and minus) to write programs that can be executed in a variety of ways. Essential to writing a functional computer program is syntax, which is the correct ordering of words and symbols to create the desired output or functionality.

      Syntax Error Basics

      • When you incorrectly order words and symbols and try to compile or execute a program, the compiler, which takes your code and translates it into commands for the computer's processor, will return a syntax error. This syntax order usually contains a line number, which will take you directly to the incorrect code, as well as an error message, which can be very general ("Syntax error at line 271") or specific ("Syntax error: If without End If, line 271).

      Examples of Error Messages

      • Syntax errors may take other forms, as well, depending on the specific error. Not all syntax errors will say "Syntax error". Some examples of other types of error messages, taken from Visual Basic, include: "Invalid use of '.', '!', or '()'", "Wrong number of arguments used with function", and "Object doesn't support this property or method".

      Interpreting Syntax Errors

      • Each of these error messages would appear with a line number, and looking at that specific line of code along with the error message will give you the information you need to correct your code.

      Troubleshooting Syntax Errors

      • When you are faced with a syntax error you can't figure out, a good first stop is the documentation for the programming language you are using. Look up the specific words or commands used in the line triggering the error, and compare your code to the documentation. You should be able to find a description of the correct syntax, which will help you pinpoint the syntax error.

    Related Searches

    References

    Resources

    Read Next:

    Comments

    You May Also Like

    • What Is a Syntax Error?

      Syntax errors in computer programming happen during the process of writing code to run a program. If the programmer makes an error,...

    • How to Fix Syntax Error

      Using the correct syntax is vital when programming applications or creating websites. A single missing comma or semicolon can cause your code...

    • Types of Syntax Errors

      Types of Syntax Errors. Syntax errors are programming mistakes from a typo, incorrect variable data type or other mistyped coding error. They...

    • What Is a Syntax Error?

      What Is a Syntax Error?. Part of the series: Computer Networking & Hardware. Syntax errors can occur when there is a typo...

    • The Computer Science Relationship Between Context-Free Grammar and Syntax

      A context-free grammar is a set of computer science rules governing sequences, or strings, of symbols. For example, writing a sentence in...

    • What Is a Syntax Error in Java?

      Java syntax errors refer to mistakes made by a programmer in implementing the grammar of the Java programming language. It doesn't cover...

    • How to Solve a Syntax Error in IE

      A syntax or run time error in Internet Explorer occurs when a Web page encounters a scripting error. In most instances, the...

    • How to Correct a Syntax Error

      Syntax errors are the most common problem for developers. A single syntax error can cripple even the best applications and websites. You...

    • How to Change a Volume Syntax Name

      The syntax on a PC computer is the format in which the computer language is presented, complete with punctuation and the correct...

    • How to Get Rid of Invalid Syntax Errors?

      There may be times when an "Invalid Syntax Errors" message appears in the middle of your Web browser while you are surfing...

    • Differences Between a Syntax Error and a Logical Error

      Differences Between a Syntax Error and a Logical Error. An error can disrupt program flow, create nonsensical results or cause a program...

    • How to Fix Syntax Errors in Windows XP

      A syntax error in the Windows XP operating system can occur in conjunction with the use of Internet Explorer when visiting a...

    • Definition of Syntax Errors

      Syntax errors are mistakes in the way the code is created. Programming languages require each variable and code block to be typed...

    • What Is Syntax?

      Syntax revolves around words. More specifically it focuses on how words are arranged in a sentence. Words can be arranged regularly or...

    • How to Fix Errors in Programs

      Computer programmers are familiar with errors in programs. Alternately referred to as "bugs," programming errors often surface all throughout the development stages...

    • How to Clean Up Computer Errors for Free

      There seem to be as many errors a program can undergo as actual actions performed. Because of the wide range of issues,...

    • Definition of Computer Programming Languages

      While humans speak languages laced with metaphor, idioms, inflections and subtext, computers require languages free from these ambiguities in order to function...

    • How to Debug a Syntax Error

      Debugging syntax errors is one of the key tasks in programming. Having the ability to find and fix errors is what makes...

    • How to Identify Syntax

      Syntax consists of the rules and structure of natural spoken and written languages. Nouns, verbs, adjectives and tenses are all parts of...

    Follow eHow

    Related Ads