Custom Statement Error

Hello Everybody,

This is a Pan6 question.

I have a custom statement, which has worked flawlessly for years. I decided to make a small change to the code.

The first thing I did was to select menu Wizards-Developer Tools-Custom Statements. In that window, I clicked Statement-New Statement, and named a new statement. I then double-clicked the ORIGINAL statement, copied the entire code, and pasted that code into the new custom statement code window. I then saved, and selected Statements-Register New/Modified Statements.

At that point, I thought, I had two identical custom statements with slightly different names. BUT …

Now, neither custom statement works. When I call the original custom statement, I get an error window “Implicit assignment to current cell has been disabled!” I don’t know what is the “current cell” the message refers to. The code does not write to any cell, nor does it refer to any cell.

I inserted a message statement just before the final RTN, and the message window appears. So, the entire custom code runs without an error. But the statement stops at the error window (apparently at the point when it returns to the calling macro) and no longer works. The next statement in the calling macro is a debug command. I’m at my wit’s end as to what’s wrong.

I have a Time machine backup. Is there some file, or folder which I can resurrect to get me back to where I was?

Thanks for any help.

Vic

An implicit assignment is a statement that contains the text to be assigned in quotes, and nothing more. That text is assigned to whichever cell happens to be active at the time. It’s a holdover from Panorama 1. Few people knew the feature existed, and it was more likely to be used unintentionally, than intentionally. By default, this feature is disabled in Panorama 6.

A common way to use this feature unintentionally, was to give a parameter to a statement that didn’t take a parameter. Something like

Paste "some text"

or

CloseFile "MyDB"

That’s why it’s called an “implicit” assignment. Suppose you had a procedure that contained only this text.

"hello"

If you ran this procedure in Panorama 1 thru 5, it would put the word hello into the current cell. In other words, it would assign the value hello to the current cell. Usually an assignment is “explicit” with an = symbol, for example

Greeting = "hello"

Since there is no = symbol in the first example, that is considered an “implicit” assignment. As Dave pointed out, it was very easy to accidentally put an implicit assignment into code without realizing it. There would be no error message, but your code would write over data when you didn’t mean for it to do that. So in Panorama 6, this feature was disabled. Instead of writing over data, it produced an error message. If you really wanted to use this feature, there was a way in Panorama 6 you could re-instate it, but I don’t remember what it was. In Panorama X there is no way to use implicit assignment. Instead, you can get the same effect with this code.

«» = "hello"

Chances are, however, that the implicit assignment in your code is a bug, which you should locate and eliminate.

Hello Dave and Jim,

Thank you for taking the time in your busy schedules to respond to a Pan6 question.

Yes, Jim, I figured I had a code error. But for the life of me I couldn’t spot it. The macro was checked and double checked, and triple checked in an outside database. It always worked correctly.

And then, there it was. The error was NOT in the code, but in the PARAMETER section of the custom window. Somehow, The word “OPTIONAL” got deleted from the fourth parameter. That parameter is sometimes supplied to the statement, sometimes not. That was what was messing things up.

With the “OPTIONAL” word added back, now everything is back to normal.

NEW QUESTION: How do I now delete the temporary custom statements I added while trying to track this error down? There is a menu command to ADD STATEMENT, but no command to delete a statement.

Best regards,
Vic

In the Custom Statements wizard select your library file and then double click the custom statement you want to eliminate. That procedure will then open where you can select Delete Procedure from the Setup menu. Restarting Panorama 6 should now have it eliminated.

If you want to remove the entire custom library file you can go to the Panorama 6 application folder and select Extensions/Libraries and delete that file. A Pan restart will have it removed from the Custom Statements wizard altogether.

Thanks, Gary.