fatal syntax error expected but found

readln (‘p’);
чтение строки — это шикарно

writeln (‘Найти площадь прямоугольника’);
вывели текст после — логика на высоте

p=h*v;
плевать, что считали, правда h и v — не определены

h=20;
v=30;
о да, логика та же, надо определить h,v

can any one fix this?

write(‘Enter a selection(10,20,30,40):’);

writeln(’10 was selected’);

writeln(’20 was selected’);

writeln(’30 was selected’);

writeln(’40 was selected’);

writeln(‘something else was selected’);

Содержание

  1. 5 Answers
  2. Primary tabs
  3. Forums:
Содержание
  1. 5 Answers
  2. Primary tabs
  3. Forums:

5 Answers

I don’t know any Pascal, but isn’t the problem obvious? Read your own title: you have a syntax error where you have accidentally used a fullstop where you should have used a semicolon. Look at the last line of your code. I assume you should have used a semicolon instead of a full stop to get:

Also, syntax errors would be less frequent if you used a code editor which had support for syntax highlighting so it would be more obvious where the syntax of your code is incorrect.

You have too few ends. The case-statement contains a number of items each wrapped in their own begin-end pair, the penultimate end is the end of one such pair. The last end in your code is the end that matches the start of the case-statement.

The compiler is expecting to see and end that matches the begin that comprises the body of the program, but it encounters a . instead.

So amazed that I found this topic already answered! Its like you’ve read my thoughts!

I was wondering the same thing too yesterday

Primary tabs

Forums:

При создании программы на Паскаль или Делфи может возникать такая ошибка:

unit1.pas(1,1) Fatal: Syntax error, «UNIT» expected but «PROGRAM» found

возникает для программы в lazarus delphi в случае, если вы используете неверный для консольного приложения тип проекта.

Источник: computermaker.info

Техника и Гаджеты
Добавить комментарий