Procedure Error Doesn't Stop Procedure

Hello Everybody,

I have not been following the forum closely, so I hope this question isn’t one already reported and discussed. It relates to how Pan X reacts to a procedure error.

I have a simple procedure which opens a database file with an OPENFILE command. The next step is a FIELD command, e.g.,

Field «myFieldA»

There is no myFieldA in the just-opened database. However, Pan X simply stops the procedure, without generating an error message warning that myFieldA doesn’t exist. This might cause confusion if the user believes the procedure has run to the end, when in fact, no subsequent steps have been carried out.

Pan X should give an error warning, as Pan 6 does, that there is no myFieldA.

Regards,
Vic

I cannot duplicate your results in either Panorama X 10.1 or the upcoming 10.2 version. When I do this, an error message warning appears, as it should.

Jim, it will do so when the macro window is closed.

But if the macro window is open, as it will be while writing or debugging the procedure, the error message DOES NOT appear. The macro just stops at the offending step.

Vic

When the procedure window is open, error messages appear at the bottom of that window, rather than in a separate alert window.

Dave,

Dave,

That is true only if the procedure window is referring to its own database. If a procedure in DatabaseA, which refers to Field “myField”, opens DatabaseB, which does not have a field called “myField”, then no error message appears anywhere. The macro just stops. In Pan X, which can have several procedure windows open at the same time, you might not be aware that the program has not finished, but just stopped.

No, this is simply not correct. If code in an open procedure window encounters an error, the procedure window will be brought to the front, the error message will appear in the status bar, and the code that caused the error will be highlighted. It doesn’t matter what database is active. There is no doubt that an error has occurred. Here is the exact error you are describing, you can see that the error message definitely appears.

This is not new behavior for Panorama – it goes back to at least Panorama 4, and maybe even Panorama 3.

Does the database you are opening have an .Initialize procedure? Maybe the error isn’t the field statement at all, but rather a problem in the .Initialize procedure. Panorama X 10.1 doesn’t handle errors in the .Initialize procedure very well, this has been fixed for Panorama X 10.2.

Hello Jim,

Here is my code highly simplified (I eliminated all steps beyond the Field command for this message).

image

When I first ran this procedure, the new database window overlapped and covered the macro window, and remained the active window. So all I saw on-screen was the new window opening properly, and no further action. I reasonably assumed the entire code had run, with no error messages.

I now have moved the procedure window so it is no longer overlapped by the new database window. Here is a screen shot after the macro is invoked.

image

Note that there still is no error message, even at the bottom of the procedure window, although the Field command is highlighted. I had missed that initially because I was focusing on all the following steps (omitted here). The new database window is still the active window - not the procedure window

Since single-stepping is no longer available in Pan X, I write code in blocks at a time, checking the entire block for problems. If all looks good, I write the next block.

Jim, It should be non-controversial that if Pan X encounters an error, the user should be notified with an unambiguous message, which must be acknowledged by “OK”. Losing single-stepping was hard enough, but for amateur and infrequent coders like myself - we can use all the help we can get. If such an error message can be arranged in a Pan X update, it will make Pan X an even better program.

Regards,
Vic

I tried to replicate this issue. What I see is, using 10.2.0, with the procedure window open, the procedure window is brought to the front, and the error message appears at the bottom of the procedure window, but when I click on any other window, the error message disappears and the message returns to “Ok”. Is it possible, Vic, that that is what is happening?

I do not agree. If the procedure window is open, then no error alert is displayed – the procedure window is brought to the front with the error message displayed at the bottom of the window. There is no need in this situation to force the extra step of displaying and dismissing a modal alert. It has worked this way for at least 20 years, I think over 25 years, and no one has objected ever before.

This might cause confusion if the user believes the procedure has run to the end, when in fact, no subsequent steps have been carried out.

If “a user” is running this procedure, they presumably would NOT have the procedure window open. In that case an alert does appear, as shown here.

I’m sure that is what Vic is seeing. The reason for this is that the status window not only shows runtime errors, but also syntax errors. Whenever you click on another window, Panorama checks the syntax of the code. Since the syntax is correct, the “Ok” message appears at that time.

I think this has taken up enough of the groups attention, I’m going to close this topic now.