Parameter( function error when procedure is called

I have a Text Display Object in a form. In its Procedure Panel it has this code:

global procedureDelete
procedureDelete = "SetWindows"
call ".Import/export procedures"

The “.Import/export procedures” procedure contains this code:

zoomwindow 23,0,650,500,"nopalette,noscroll,notoolbar"
setwindow 23,500,500,430,"nopalette,noscroll,notoolbar"
openform "ReadMe"
return

When I quit Panorama X, open the form and click on the Text Display Object, I get the error message: “parameter( function: Current procedure was not called as a subroutine.” before anything is executed in the second batch of code. There is no .Initialize procedure. I get the same message when I trigger the code from any other object. If I click on the object a second time, everything works as it should. Inserting a message statement into the first code displays the correct value for the * procedureDelete* variable.

What’s happening?

When you say “has this code” and “contains this code”, does that mean you have listed the entirety of the code? Or is this a subset of the code? The error message you are getting can only occur when the parameter( or info(“parameters”) functions are used, and I don’t see either of those.


By the way, in new code I never use the setwindow statement any more – you can now put these options directly into the openform statement. It’s ok to use setwindow if you really like it for some reason, but I think it is easier to use one less statement, like this

openform "ReadMe","rectangle",rectanglesize(23,500,500,430),"toolbar","no","scrollbars","no"

I have listed the entirety of the code other than the fact that code in the procedure is within an if/endif structure, as in:

if procedureDelete = "SetWindows"    
    zoomwindow 23,0,650,500,"nopalette,noscroll,notoolbar"
    setwindow 23,500,500,430,"nopalette,noscroll,notoolbar"
    openform "ReadMe"
    return
endif

There are no parameters which is why I’m baffled.

Using message statements, it appears that the zoomwindow works but the “ReadMe” form doesn’t open. Interestingly, if the initial window is already in the position specified by the zoomwindow statement, there is no problem. Using the rectangle option in the openform statement makes no difference (it presumably uses the setwindow statement anyway).

I suspect that the problem arises from some interaction between the zoomwindow statement and the setwindow statement, both of which DO have parameters

I sent the file to Jim who couldn’t replicate the problem. I rebuilt the whole thing and now it works fine so who knows what was happening? That’s a rhetorical question - is there a rhetorical emoji?