Attention, C++ boolean expressions are evaluated from left to right, so that `MCR_exec()` is executed before `MCStringDivideAtIndex()`. For now, using the Livecode function `replacetext()` crashes because `t_tail` is obviously a null pointer.
Also, it might be better to use `MCStringCopySubstring()` to create the substring, instead of `MCStringDivideAtIndex()` since the head is never used.