If subtxt() is used with a result variable that stores the result of a preceeding indexoftxt() or a mathematical operation, then the result is NaN instead of the extracted string.
If the result variable has never been used or stores a text, everything is OK.
Code
set(var, "A string! A string.");
indexoftxt(num_result, get(var), "!" );
subtxt(num_result, var, 2, 7);
set(str_result, "abc");
subtxt(str_result, var, 2, 7);
trace('result in num_result: ', num_result);
trace('result in str_result: ', str_result);
Output:
INFO: result in num_result: NaN
INFO: result in str_result: string!
It looks like 'num_result' has an attribute "I'm a numerical value" which is not changed in subtxt().
Best regards,
Wolfgang