我的 pascal 程序中的致命语法错误

Fatal syntax error in my pascal program

我有一个编程作业,我的老师给了我这个例子,但是当我尝试 运行 它说

Fatal: Syntax error, ; expected but VAR found on line 14/1.

有什么办法可以解决这个问题吗?

代码如下:

http://pastebin.com/gp8Q7GaV

针对 Pascal 和英语初学者的错误消息细分:

错误消息说明了很多事情:

`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

查看代码(带行号)

11.const
12. vcharge=1000;
13. interrate=0.08
14.var
15. name,ward:string;

很明显,缺少的分号应该在第 13 行的末尾(实际上在语法上是正确的,如果放在第 14 行的开头,单词 'var' 之前,但那不是我们如何编写 Pascal)。