A procedure that is used on many forms, reliably gets an error on one form:
parameter( function: Current procedure was not called as a subroutine.
Cut down to bare-bones, the procedure is very basic:
Local a,b,c,d
GetMaxWindow a,b,c,d
ZoomWindow a+85,b+40,700,850,“NoScrollBar NoToolBar”
If the form is already open and does not require resizing, there is no error.
If the form is already open but not at the desired size, or if it is not open, the error appears even though the result is the form being properly opened and sized.
The only form action is a variable update, but if the form being already open doesn’t matter one way or the other, this would seem irrelevant. To be sure though, disabling the form action made no difference.
The only possible conclusion is that there’s something about the form causing the issue, but I can’t find anything and have no idea of what to look for.
There has to be something else going other than what you have stated here.
It’s super easy to make a procedure that generates this error message. All you need is this one line:
let x = parameter(1)
Run this and BAM!, you get that error. But if you call this procedure from another procedure, you won’t get the error. (You may get a different error if you don’t actually pass a parameter.)
So, the only way this error can occur is if you use the parameter( function in a procedure that isn’t called from another procedure. You aren’t doing that in the code you posted, so I have to assume that this isn’t the code that is causing the error.
FYI, internally Panorama doesn’t care whether the form requires resizing or not. The code path is the same. In other words, it does not check whether or not resizing is required, it just does the resize whether it’s needed or not. It’s possible that Apple’s code checks whether the resize is required.
How can you run this code if the form is not open?
Again, what?? The ZoomWindow operation requires that the window already be open, so I don’t understand why you keep saying that this code can run without the form already being open. If the form isn’t already open then it is going to apply this to whatever window happens to be open. I’m suspecting that you’ve gone a bit too far in cutting the code down to bare-bones.
In any case, is there a parameter( function in the form event code?
The fact that the error happens only in one form strongly suggest to me that the problem is in the form event code. That’s the only thing that is going to be different for different forms. And you would definitely get an error if you used a parameter( function in this code, because this code is not called by another procedure (it is called directly by Panorama as a top level procedure).
FYI, you could write this code without any variables at all in a single line of code. I’ve split it across multiple lines for clarity.
What I had posted was the barebones part of the procedure where the error occurs within a consistent set of circumstances. Earlier it was determined whether or not the desired form was the open form and did a GoForm if necessary. Then came the zoom, if necessary to ensure that the window was at the desired size. I could’a/should’a included that explanation but I believe I was trimming the procedure even as I wrote the post.
In all circumstances, the correct form is displayed when this part of the procedure is run. So, with that form open and active, the error occurs if the window is resized. It does not occur if the window is already at the desired dimensions.
The Form action to refresh a variable should already be covered but again, even with it disabled, the error occurs.
You did a lot of typing in your response, but unfortunately you didn’t really include any new information. With the information provided so far, I have no idea what the cause of this error is. Since apparently the problem can be duplicated on command, perhaps the best bet would be to send me a copy of the database along with detailed instructions on how to cause the problem.