Program opn; uses crt; const inp=('Введите строчку, преобразованную в опн '); outp=('Результат равен '); sp=#32; err=('Ошибка: '); var el:array[1..128] of elements; e,x,i,k:integer; ch1,ch2:real; s,d:string; stack:PElement; begin stack:=nil; e:=0; x:=0; i:=0; k:=0; s:=''; d:=''; ch1:=0; ch2:=0; writeln(inp); read(s); for i:=1 to length(s) do {начало классификации} with el[i] do begin k:=pos(sp,s); d:=copy(s,1,k-1); val(d,x,e); if (e=0) then num:=x else op:=d[1]; delete(s,1,k); end; {конец классификации} {здесь вроде как нормально но дальше ошибки выдает, при взятии элементов} for i:=1 to length(el) do if el[i] in num then Push(el[i]); if el[i] in op then begin case op of '+': begin ch1:= pop(stack); ch2:= pop(stack); ch1:= ch1 + ch2; push(ch1); end; {и так же остальные операции} 

links to all code compiler output

 Сompiling your program... prog.pas(99,36) Error: Incompatible type for arg no. 1: Got "elements", expected "SmallInt" prog.pas(102,24) Error: Identifier not found "op" prog.pas(103,19) Error: Constant and CASE types do not match prog.pas(108,26) Error: Incompatible type for arg no. 1: Got "Real", expected "SmallInt" prog.pas(110,19) Error: Constant and CASE types do not match prog.pas(115,26) Error: Incompatible type for arg no. 1: Got "Real", expected "SmallInt" prog.pas(117,19) Error: Constant and CASE types do not match prog.pas(122,26) Error: Incompatible type for arg no. 1: Got "Real", expected "SmallInt" prog.pas(124,19) Error: Constant and CASE types do not match prog.pas(136,28) Error: Incompatible type for arg no. 1: Got "Real", expected "SmallInt" prog.pas(139,19) Error: Constant and CASE types do not match prog.pas(144,26) Error: Incompatible type for arg no. 1: Got "Real", expected "SmallInt" prog.pas(100,13) Error: Boolean expression expected, but got "Char" prog.pas(148,4) Fatal: There were 13 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled) 

I can not understand why the compiler swears to take an element from an array

  • And what is the question? - alexlz
  • @alexlz is really -______- forgive forgiveness, I can not understand why the compiler swears to take an element from an array._. in particular on case op - mayhem
  • I could not see the output of your compiler (it could have been included in the question - you included a bunch of code). Errors: Line 50 (f. Pop) - the Item identifier is not defined. The compiler is 100% right. Page 63 (function raise) - brackets are not balanced). Alas ... - alexlz
  • @alexlz added the bracket to raise, I agree, the jamb ._. but still, how can I fix the item in line 50? Plus, did I organize the classification of the elements correctly? Well, sort of like yes._. record type, two fields. But here at selection of elements of a hogwash. _. but I took a way from the set ._. "if el [i] in num then ..." - mayhem
  • one
    And what did you want from line 50? If you return this value from the pop function, then the string d. Pop: = TopPointer ^ .Item; Since no return'ov there. If I have not quite forgotten pascal. Well, then you still have errors. Learn the language, correct errors - alexlz

0