tbs0258.pp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. program test_set;
  2. uses erroru;
  3. procedure test;
  4. var
  5. i : longint;
  6. j : integer;
  7. k : word;
  8. l : shortint;
  9. m : byte;
  10. x : array [1..32] of byte;
  11. begin
  12. for i:=1 to 32 do x[i]:=$ff;
  13. i:=1;
  14. if i in [1,3,5,8,11,14,15] then
  15. writeln('1 is in [1,3,5,8,11,14,15]')
  16. else
  17. begin
  18. writeln('Error in set');
  19. error;
  20. end;
  21. i:=135;
  22. if i in [1,3,5,8,11,14,15] then
  23. begin
  24. writeln('Error : 135 is in [1,3,5,8,11,14,15]');
  25. error;
  26. end;
  27. i:=257;
  28. if i in [1,3,5,8,11,14,15] then
  29. begin
  30. writeln('Error : 257 is in [1,3,5,8,11,14,15]');
  31. error;
  32. end;
  33. l:=-1;
  34. if l in [1,3,5,8,11,14,15,255] then
  35. begin
  36. writeln('Error : -127 is in [1,3,5,8,11,14,15,255]');
  37. error;
  38. end;
  39. i:=257;
  40. if l in [1,3,5,8,11,14,15,255] then
  41. begin
  42. writeln('Error : longint(257) is in [1,3,5,8,11,14,15,255]');
  43. error;
  44. end;
  45. for i:=1 to 32 do x[i]:=0;
  46. i:=135;
  47. if i in [1,3,5,8,11,14,15] then
  48. begin
  49. writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]');
  50. error;
  51. end;
  52. end;
  53. begin
  54. test;
  55. end.