calling funcions in an external JS file from within the file

Re my last post in 'transparency etc', I don't think XML files are causing this.
I've almost found a workaround but I'm too tired to carry on tonight.
The problem has something to do with how variables are sent from the JS file to the main application. showRequest uses pgTBObjSet + user to send a string in the value parameter to a field in the main app that gets the required translation and then uses showRequest2 to display the dialog box. value contains the contents of 4 text variables separated by the "§" character. These come from the parameters of the showRequest function function tbfunction_showRequest(txt, button1, button2, objName) The problem is that button2, and objName are often null. This is not a problem if showRequest is called from the main app. The field that gets the translation receives, for example, "The media player will start again. Press on a Ctrl key to add another action.§OK§§". However if showRequest is called from within the JS file it receives "The media player will start again. Press on a Ctrl key to add another action.§OK§undefined§undefined". This seems to prevent it working and no dialog box appears.
I think I''ll probably find a fix but I'd like to know why this error has only appeared recently. It had worked perfectly for years until now. I hope there are no more new unexpected errors like this but I have a feeling there may well be a few more. The system seems to have got far fussier than it used to be for some reason.
I've almost found a workaround but I'm too tired to carry on tonight.
The problem has something to do with how variables are sent from the JS file to the main application. showRequest uses pgTBObjSet + user to send a string in the value parameter to a field in the main app that gets the required translation and then uses showRequest2 to display the dialog box. value contains the contents of 4 text variables separated by the "§" character. These come from the parameters of the showRequest function function tbfunction_showRequest(txt, button1, button2, objName) The problem is that button2, and objName are often null. This is not a problem if showRequest is called from the main app. The field that gets the translation receives, for example, "The media player will start again. Press on a Ctrl key to add another action.§OK§§". However if showRequest is called from within the JS file it receives "The media player will start again. Press on a Ctrl key to add another action.§OK§undefined§undefined". This seems to prevent it working and no dialog box appears.
I think I''ll probably find a fix but I'd like to know why this error has only appeared recently. It had worked perfectly for years until now. I hope there are no more new unexpected errors like this but I have a feeling there may well be a few more. The system seems to have got far fussier than it used to be for some reason.