Pascal编程问题

时间:2014-03-11 15:07:45

标签: pascal

我在pascal中写了以下几行:

procedure editor;
    begin
    clrscr;
    frame;
    levframe;
    assign (level,'level.dat');
    rewrite(level);
    for i:=1 to 600 do write(level,'0');
    for i:=1 to 30 do for j:=1 to 20 do levmem(i,j):='0';

(变量已声明)

译者说:

Lp1.pas(53,43) Error: Illegal expression
Lp1.pas(53,43) Fatal: Syntax error, ";" expected but "(" found

问题:为什么不起作用? (53,43)位于'levmem(i,j)'的最后一行。谢谢你的回答。

1 个答案:

答案 0 :(得分:3)

假设levmem被声明为2D数组,语法应为:

for i:=1 to 30 do for j:=1 to 20 do levmem[i][j]:='0';
                                          ^^^^^^