t54_strcat_strnum.pas 470 B

12345678910111213
  1. { t54_strcat_strnum: `s + 1' - a string and a number - is a type error.
  2. A STRING operand makes `+' the concatenation operator, and then BOTH operands
  3. must be strings or CHARs; a number is not one. The string on the left is
  4. what selects the concatenation path, and the number then fails the string
  5. operand test. Expected: ETypeErr (56) at the `+'. }
  6. program t54_strcat_strnum (input, output);
  7. var
  8. s : string[8];
  9. begin
  10. s := 'abc';
  11. writeln (s + 1)
  12. end.