Error: Variable 'thisapp' is not declared

Error: Variable 'thisapp' is not declared

Hi,
I'm getting a weird error message when trying to use a custom function in the OnLoad script of a stateless form: "Variable 'thisapp' is not declared". The form is https://creator.zoho.com/ahatton/form/278/3/scriptbuilder/#  and I have allowed edit access to support.

The code I'm using is (and I generated this using the script build to make sure):
  1. prefix_str=thisapp.child_registration.getPrefix(input.child_number);
and the function declaration is:
  1. string child_registration.getPrefix(int child_num)
    {
        prefix = "";
        if (child_num  ==  1)
        {
            prefix = "first";
        }
        else if (child_num  ==  2)
        {
            prefix = "second";
        }
        else if (child_num  ==  3)
        {
            prefix = "third";
        }
        else if (child_num  ==  4)
        {
            prefix = "fourth";
        }
        else if (child_num  ==  5)
        {
            prefix = "fifth";
        }
        else if (child_num  ==  6)
        {
            prefix = "sixth";
        }
        else if (child_num  ==  7)
        {
            prefix = "seventh";
        }
        else if (child_num  ==  8)
        {
            prefix = "eighth";
        }
        return prefix;
    }




































The function works fine when I add it inline.