Reputation: 3
I have a programming assignment and my teacher gave me this example, however when I try to run it it says
Fatal: Syntax error, ; expected but VAR found on line 14/1.
Is there any way to fix this?
Here is the code:
Upvotes: 0
Views: 1520
Reputation: 21045
A breakdown of the error message for beginners in both Pascal and English:
The error message says many things:
`Fatal:` means that the error prevents further processing/running
`Syntax error` means that the code is incorrectly formulated
`; expected` means that the code parser expected to find a semicolon
`but VAR found` instead of the semicolon, the word VAR was found
`on line 14/1` means that the error was detected on line 14 in character position 1
Looking at the code (with line numbers)
11.const
12. vcharge=1000;
13. interrate=0.08
14.var
15. name,ward:string;
it is clear that the missing semicolon should be at the end of line 13 (actually it would be syntactically correct, if placed in the beginning of line 14, before the word 'var', but that is not how we write Pascal).
Upvotes: 3