Domanda

I wrote the following lines in 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';

(The variables are declarated)

The translator says:

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

Question: why doesn't it work? (53,43) is in the last line, at 'levmem(i,j)'. Thanks for answers.

È stato utile?

Soluzione

Assuming levmem is declared as a 2D array, the syntax should be:

for i:=1 to 30 do for j:=1 to 20 do levmem[i][j]:='0';
                                          ^^^^^^
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top