The result of _STRING_TO_BUFFER function is completely useless. It always returns TRUE.
But it could be more useful while writing multiple strings to the buffer. I propose to calculate a position for the next function call.
FUNCTION _STRING_TO_BUFFER : INT
< function text >
_STRING_TO_BUFFER := end +1;
It will be easier to fill the buffer with strings in this case, for example:
pos := _STRING_TO_BUFFER ('The value of the Str variable is ', pos, ptSend, BufferSize);
pos := _STRING_TO_BUFFER (Str, pos, ptSend, BufferSize);
pos := _STRING_TO_BUFFER ('$R$N', pos, ptSend, BufferSize);
Thank you all for attention.