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