In Borland Pascal programs two consecutive pluses were often used when writing string expressions in several lines
S := some_long_string_expression +
+ some_long_string_expression +
+ some_long_string_expression;
It looks good and improves the readability of the code.
FPC doesn't understand more than one plus for strings (although it does for numbers).
To minimize the editing of old code when adapting to FPC, I partially solved the issue by operator overloading:
Operator + (const S: String): String; Inline;
begin
Result := S;
end;
But two problems remained unresolved:
(a) this does not work for definitions of multi-line string constants
(b) it doesn't work in expressions like
S := some_long_string_expression +
+ CHAR + some_long_string_expression;
I was unable to overload the operator for Char in a similar way (
«Impossible operator overload»).
It is not difficult to correct the code a little, but maybe some solutions are still possible?