Syntax error

A syntax error is an error in a source code file, which prevents a compiler from being able to process it into an object file or an executable file. When the program compiles okay, but has problems when running, that, however, is a "run-time error." Syntax errors are of two types: using the syntax wrong, or using the wrong syntax.

Using the syntax wrong is when you do things like
 * Misspell a word, for example, misspelling the keyword begin as bagin or begni.
 * Having erroneous characters accidentally in the file.
 * Leaving a ;|semi colon (";") off, or including one where it's not allowed (especially before else).
 * Using a keyword as an identifier, like having a var section include a variable like this: var until:integer
 * Failing to close a comment, so that the compiler, "runs off the end of the program." This can happen if your compiler permits the use of "nested comments".

Using the wrong syntax is when you use a legal item in an illegal fashion. These include:
 * Where the compiler permits variables to be initialized in a unit, only if the variable is declared between interface and implementation, attempting to initialize a variable in a procedure or function would not be allowed.
 * Using a conditional compilation feature where it is not allowed, like using (*$ELSE without a preceding {$IF, {$IFDEF, or {$IFNDEF.
 * Using a keyword where it is not allowed, like declaring a record as absolute (a record is just a representation; the variable is what can be assigned a specific place such as absolute.
 * Using non-standard features when either the compiler doesn't support them, or where the compiler has had a compiler directive to only allow standards compliance.
 * Using object oriented features on a compiler that does not offer them.