no, the string-length() function should work without further trouble in 4.2.
I don’t know why you get such a strange error. Perhaps you should
make sure it is the built-in function you refer to and use a prefix, i.e.:
I do not know any details about your environment, but the path in brackets,
i.e. programs/program/period/schedule/hours/@startHour looks strange to
me. A path should start with a call to the input() or collection() function, or
with a variable ?