I try to make the function take the words from the array and check their presence in the string, what's the error help? NOW ERROR HERE IS HERE IN VAR, the error is shown on the brackets when the array is declared. Here is the code:
procedure TForm1.N22Click(Sender: TObject); var id, i, s: integer; stroka: string; n, k: integer; a : array[1..5] of String[10]=('VAR','END','BEGIN','FUNCTION','IF'); begin ListView1.Clear; id:= 0; for i := 0 to SynEdit1.Lines.Count-1 do begin { do if не должно быть на одной строке } if Pos('do if', SynEdit1.Lines[i]) <> 0 then begin ListView1.Items.BeginUpdate; ListView1.Items.Add; id:=id+1; ListView1.Items[id-1].Caption:=IntToStr(id); ListView1.Items[id-1].SubItems.Add('[Строка: '+IntToStr(i+1)+'] - do if не должен быть на одной строке'); ListView1.Items.EndUpdate; end; { зарезервированные слова - не работает} if Pos(a[i], SynEdit1.Lines[i]) <> 0 then begin ListView1.Items.BeginUpdate; ListView1.Items.Add; id:=id+1; ListView1.Items[id-1].Caption:=IntToStr(id); ListView1.Items[id-1].SubItems.Add('[Строка: '+IntToStr(i+1)+'] - зарезервированные слова не должны заглавными буквами'); ListView1.Items.EndUpdate; end; end;