Incrémentation d'un entier
Bonjour,
Pourquoi le code suivant me renvoie-t-il une erreur de compilation ?
Code:
1 2 3 4 5 6 7 8 9 10
| begin
with GridIn do begin
RowCount := RowCount +1;
Cells[1, RowCount -1] := 'In01';
Cells[2, RowCount -1] := 'Text In01';
inc(RowCount);
Cells[1, RowCount -1] := 'In02';
Cells[2, RowCount -1] := 'Text In02';
end;
end; |
Citation:
[dcc32 Erreur] Unit1.pas(35): E2064 La partie gauche n'est pas affectable
La ligne 35 est inc(RowCount) Quelle partie gauche ? RowCount ? Si tel est le cas, pourquoi RowCount := RowCount +1 fonctionne-t-il et l'autre non ?
Merci.