Pan X not ready for me yet

I have transferred some of my Pan6 databases to Pan X. But even on really simple databases I get crashes and freezes. “Choices” fields work unreliably. I am not a developer but like to use Panorama’s script/language and I many of my databases are linked. But for the time being I am giving up on Pan X. Considering that almost every time I try to get some work done I spend more time Force Quitting and restarting than entering data. I was so looking forward to this but I will save my Pan X ‘time’ for when it’s more mature (really hate to say this).

Peter

my experience is very similar.
i spent most of the day yesterday working on a project in panx with virtually no result that would have required about an hour and a half to complete in pan6.
the only thing that keeps me using panx at all is stubbornness.

I agree also but I have faith Jim will get PanX to where it should be. I’m just wondering why it is so very different from 6 and not even remotely as functional. I’ve play with it a bit and converted a couple of databases but it’s just not worth my time until it’s fully compatible. It’s as if it’s not even a Provue application.

I am a long-time Panorama user, and have had similar experiences with Pan X. However, I am using it, even though I get frequent crashes. In some ways it is better than Pan 6, but it definitely needs more work.

People…

You are using Panorama X to have an early access to what will be another amazing database product from ProVUE. This is an opportunity to see what is coming and to potentially influence what the release version will look like and how it will work. At this time, there will be issues, there will be problems. There are new features and capabilities in Panorama X that do not exist in Panorama 6. There are features that currently exist in Panorama 6 that do not yet exist in Panorama X.

If the current version requires more of your resources of time, etc, than you have available at this time, relax. Put it down. Take another look at it in month or two. It will be different. It may be awesome, it may be what you were waiting for, or it may not yet be.

There is no upside to declaring your angst here as your lack of use will be dutifully noted by ProVUE as they track usage closely. Constructive criticism is always welcomed and sought.

Thanks for listening to my whine.

Robert Ameeti

Absolutely right Robert. And Sam, one day not too far in the future, Apple are going to tweak the OS in a way that makes Panorama 6 inoperable.

Well, my latest problem with Panorama X is that it is not recognizing replace( as a valid “statement”. So I save it, hoping that perhaps in some future universe it will work as it is supposed to, and then close the window, causing the program to crash.

The sad fact is that Panorama X is not stable enough for me to even experiment with.

Replace( works just fine. There must be more to your situation that is causing the issue.

Panorama X cannot accept it as a valid statement, because it is a function. And this function works pretty well when you combine it with a formula fill statement e.g.:
formulafill replace(«»,chr(13),chr(11))

Again: replace( is NO statement.

Your screenshot contains 4 formulas, but there is not any statement that would select a field and would apply those formulas to that field.

I am not saying replace( is a statement; Panorama X is.

Whether there is anything that selects a field or not is irrelevant. It should work on the current field. But it does not get that far.

If there is someplace in the Panorama documentation that says that replace( is a statement, that definitely needs to be corrected. However, I cannot find any text that says that. Certainly the main page for replace( is clear:

It’s always been the case that ANY keyword that ends with ( is a function, not a statement. Functions can be used in formulas, they cannot be used as standalone steps in a procedure. Here is your procedure in Panorama 6 – it doesn’t work there either.

Personally I think the Panorama X error message is better, but it could recognize that the keyword is a function and give an even better error message, I suppose. At least Panorama X correctly identifies the spot of the error, which is a definite improvement.

I think the correct code for what you are trying to do is this, which will work in both Panorama 6 and Panorama X.

«» = replace(«», "Early", "4:30")
«» = replace(«», "Second", "5:45")
«» = replace(«», "Very Late", "8"15")
«» = replace(«», "Late", "7:00")

The question of statements vs. functions, and where they can be used, has tripped up more than one Panorama user over the years. I’ve taken another crack at explaining this in the new Panorama X documentation. This page hasn’t been released in the Help wizard yet but it is already available on line:

The relevant section is Statements vs. Functions, which I have included below. Please note that everything stated in this section is applicable to both Panorama 6 and Panorama X.


Statements vs. Functions

In some programming languages, all actions are functions that can return a value and be used in formulas. In Panorama, however, statements and functions are distinct. In Panorama, a statement performs an action. A function, on the other hand, returns a value. You can’t use a function where Panorama is expecting a statement, and you can’t use a statement in a formula, where Panorama needs a value.

To illustrate this, consider the message statement.

message "Warning, negative balance"

When used in a program, this statement displays an alert, like this.

But since message is a statement, not a function, it doesn’t return a value and you cannot use it in a formula. So this code will not work:

x = message "Warning, negative balance"

and neither will this:

x = message("Warning, negative balance")

On the other hand, consider the sqr( function, which calculates a square root. Since this is a function and returns a value, it’s perfectly fine to use it in a formula, for example with this assignment.

x = sqr(7)

But the sqr( function cannot be used by itself. It’s not an action, so Panorama doesn’t know what to do with this:

sqr(7)

The basic rule is, if a keyword ends with a (, it’s a function and returns a value, and can be used in formulas. If a keyword doesn’t end with a (, it’s a statement and it performs an action.

I know the difference between a function and a statement. But the error message in the screenshot says Unknown statement: replace(

What I was trying to do was to write a replacement for a procedure in Panorama 6 which Panorama X does not like:

Change “Early” “4:30”…

I expected that it may not work as I wrote it, but the error message throws me.

I know that you do not like the Change statement, but it is quick and easy to remember.

Panorama gives this message because, if the first word in a valid line of code is not a field name or a variable, it must be a statement name (that may be a simplistic summation but you get the idea). In your code, replace( is neither a field nor a variable so Panorama assumes you are using it as a statement name which it isn’t. Your comment, “I am not saying replace( is a statement; Panorama X is.”, is wrong - Panorama doesn’t think replace( is a statement, it thinks that you think it is and it’s correcting that view. You would get the same type of message if you typed arraysot old,new,sep when you meant to use the arraysort statement.

Your original code used a statement, change, which has not been carried over to Panorama X. There is no exactly matching statement, so you have to write the code differently. If you choose to use the replace( function, you must use it properly.

Jim acknowledges that the message could have been more explicit. It would be great if we got messages like “In line 456 of the procedure , you’ve used a function where you perhaps meant to use a statement.” but Panorama 6 wouldn’t be out of beta yet, and Panorama X would be less that a twinkle in Jim’s eye, if that was a universal objective.

Before I blame Jim or Panorama X for an anomaly, I look for a user error (well, almost always).

Further, I’m sure you know that the change statement in Panorama 6 changes all selected records if used on a field, so your Panorama X code should involve a formulafill - Jim’s examples, like «» = replace(«», "Early", "4:30") will affect only one record.

The reason I don’t “like” the change statement is because it uses a non-standard syntax that is different from any other statement in Panorama. In Panorama 6 many statements did their own custom parsing, the result was a bit of a hodge-podge of different syntaxes. The change statement is probably the worst offender. To make it work as it did in Panorama 6 would require an entire special parser just for this one statement. I don’t think this is a good allocation of resources, especially since it is trivial for customers to rewrite procedures that use this statement, and this statement is used relatively infrequently.

Since the replace( function now allows multiple pairs of parameters, you can now write your code in a single line.

formulafill replace(«», "Early", "4:30", "Second", "5:45", "Very Late", "8:15", "Late", "7:00")

The next version of Panorama X does have a Find & Replace (aka Change) dialog, but because of the non-standard syntax, it does not have a change statement.

So it seems I could write a custom Change statement where the code for
Change Parameter(1) Parameter(2) is
formulafill replace(«», Parameter(1), Parameter(2))

Not certain why a custom parser is necessary.

I am just hesitant to try it out, because whenever I try something like this, I get a bunch of crashes. I think I have succeeded in getting a custom statement to work. Custom functions are another question, though, and experimentation leads to crashes.

Given that the new code is only one line, you certainly don’t need a custom statement. Just replace each occurrence of the change statement (or, using Jim’s example, each group of change statements) with the formulafill statement. You are going to have to replace every change statement anyway, regardless of the solution you choose.

1 Like

If you want assistance with writing custom statements and functions, contact me at audax@wideband.net.au and I can almost certainly save you a lot of time.

Your custom statement will not have the same syntax as the original change statement. The change statement required the parameters to be separated by a space. Panorama X doesn’t allow that, the parameters must be separated by a comma. Also, the change statement had optional additional options of word and caps. These were also separated by spaces and not quoted – totally non-standard.

It would be easy for me to create a new change statement that was kind of similar to the old one. However, since it would not be exactly the same, I think it would cause confusion, especially since a Panorama 6 procedure that contained the change statement would have a guaranteed syntax error. Of course it does now, but at least the syntax error is on the change statement itself and identifies that statement as the problem. If there was a "replacement* change statement the error would be on one of the parameters and it would be much less obvious that the error had anything to do with the change statement.

I have thought of making a new statement (or probably multiple related) statements for this operation. Perhaps

changetext "old","new"   // replacement for change "old" "new"

and

changeword "this","that"   // replacement for change "this" "that" words caps

This would have the benefit that a search of the help for the word “change” would come up with these statements, which could have notes about modifying a procedure that contained the old “change” statement.

However, this idea has not reached the top of my to-do list, in the meantime, there is a fully functional way to code this.