Expression contains an operator where an operand was expected


#1

As I move Pan 6 databases to Pan X, I find a number of places where this message comes up, sometimes in truncated form in an object that I expected to see data in, sometimes in an error message when I try to run a Pan 6 procedure. It appears that it’s one of those functions/commands whose syntax is different in Pan X, but it doesn’t show me the offending element and I just have to guess (so far unsuccessfully) what the problem is. Also, I’m hazy about what “operator where an operand was expected” actually means, in a way that could lead me to fixing it. I don’t know if I’m seeing the same problem in many places or different problems, since I can’t identify the offender. Any clues?


#2

Here is an example of a formula that contains this error:

2 + + 2

The second + is what is causing the problem. The + symbol is an operator, but Panorama is expecting an operand (i.e. value) in this spot.

Panorama 6 had this exact same error message, with the same cause. I don’t know of any reason why a formula would work in Panorama 6 but have this error in Panorama X. If you’re seeing this it must be possible, but I can’t think of how this could happen.


#3

And the problem is that it won’t point out which expression is causing the error.

I can see how using, for example, text display( the Pan6 way won’t work in the PanX environment because the parameters are different, but the error message for that is more explicit.


#4

In situations like that, would it be possible to highlight the offending area?

I’m imagining that it might not always be easy to highlight but perhaps most of the time?

Interesting that I was trying to come up with some expression that would not be obvious as to this type of error. When I tried this, it worked when I thought it would fail…

NumericField = 1 + Val(“123”[4,4]) + 3

Robert Ameeti
(949) 422-6866


#5

In the case of 2++3, if you run the procedure from inside the procedure, using the Run button, Pan X does indeed highlight the precise location of the error. My experience with syntax or run errors of my own is that it always does so but maybe there are occasions when it won’t.

m


#6

My problem here is that if I open a procedure that has this problem, it fails to compile right off the bat, there is no opportunity to step through it. The error message is at the bottom of the window but there is no highlight or cursor position. In this case it is a procedure that runs without incident in Pan 6, but has this error in Pan X. As I said before, some Pan X statements take different parameters than their Pan 6 counterpart, and this may be another instance of that but since the procedure can’t/won’t show me the location of it I am lost. This procedure uses 3 different array-involved functions, all of which appear to use the same syntax as Pan 6


#7
  1. Did you try to click on the error message?
  2. While there is actually no ability to step through your procedure, you can debug a procedure by commenting out parts of your procedure. So you can find the point where the error happens. Maybe it is only a small change in the syntax of a Panorama X function or statement.

#8
  1. No, I did not try clicking on the message because I was never aware that could do something. Voila! It does highlight the offender, a place where I used “==“ which I read before is no longer supported. Easy enough to correct, and I know I have some other instances of that in other procedures. So thank you for that hint, is that something that has always been supported or is that new in Pan X?
  2. Another angle I hadn’t thought of in this case, but have used it often in the past. I have a tendency to throw my hands up in despair when Pan X gives me something entirely unexpected on something that Pan 6 had no problem with, because there are so many possibilities as to what went wrong.

This forum is wonderful.


#9

Yes, that is new in Panorama X. I believe I mentioned it in the Intro to Procedures video, which is probably how Kurt knew about it.

I was wondering if that might be the problem, but I didn’t mention it because I tested it in the Formula Wizard and got a different error message than what you were seeing. But I didn’t try it in a procedure.