if you see your code closely, the name of the function that you have written is textFunction while as in the CallingSub procedure you are calling ret = testFunction().

Does your code Execute properly. Doesn't it throw any error?