0

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:

http://pastebin.com/gp8Q7GaV

1
  • Which part of the error message is difficult? The fix is to add the missing semicolon (;). Commented Mar 5, 2017 at 14:26

1 Answer 1

3

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).

Sign up to request clarification or add additional context in comments.

2 Comments

But now I am getting on line 26 / 18 sba.pas Fatal: illegal character '}' ($7D)
Yeah, that's a part of programming - searching for mistakes here and there. Now let's see how you apply the knowledge you have got, in solving this problem all on your own (well, if you get totally stuck, you can post a new question, but I would be fairly disappointed).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.