Custom statements


#1

The release notes of v 0.1.028 include:

“Now automatically loads custom statements from any databases found in /Application Support/PanoramaX/Libraries/. You can put databases in that folder manually, or you can ask the View Organizer to create one for you with the Libraries>Open User Name Custom Statements command. Later you can re-open with the same command, or with the Open View dialog or Open View wizard. Once you’ve created a library this way you can’t close it, the only way to get rid of it is to shut down Panorama and move it out of the folder. Procedures that are to be used as custom statements must have all UPPER CASE names. They can optionally have a comment block at the top that identifies the parameters, if that is present, Panorama X will check the number of parameters when the statement is used.”

I’m endeavouring to test this process but I’m not having a lot of success. I used the View Organizer to create a database with the Libraries>Open User Name Custom Statements command and I added a new upper-case-named procedure containing a simple message "hello" command. That part worked fine but then I ran into some oddities:

Firstly, it appears that the folder into which the custom statement database has been placed is, in my case, /Users/michaelkellock/Library/Application Support/PanoramaX/Libraries/. Is this what /Application Support/PanoramaX/Libraries/ is supposed to mean?

Secondly, when I use the View Organizer to register a custom statement, via the Libraries>Register Functions and Libraries menu command, I get the error message, “dbinfo(“procedures”) is not authorized.” A subsequent test with the customstatementdatabase( function returns an empty string and the info(“customstatements”) list does not include my test statement so I guess it’s not registered.

Where do I go from here?


#2

Yes.

when I use the View Organizer to register a custom statement, via the Libraries>Register Functions and Libraries menu command, I get the error message, “dbinfo(“procedures”) is not authorized.”

You’ve found a bug – this command won’t work if you aren’t me (which is why I didn’t notice this bug). In some ways this is actually good news – it’s confirmation that Panorama’s security features are working! I’ve filed a bug report.

I think that if you quit and relaunch Panorama, your custom statement might work.

Also, you might be able to get it to work by running this one line procedure.

scanlibrary "name of your library"

I think I know how to fix this problem for the next release.


#3

No it doesn’t. I’ll wait for the new version.

What do I put for “name of your library”? Database name doesn’t work. Folder name? Path?

Another odd thing - I can’t open the database in the Application Support/PanoramaX/Libraries folder. I have to remove it to edit it. Is that expected behaviour?


#4

Correction - it does now work.


#5

Should be the database name, but not including the .pandb extension.

I can’t open the database in the Application Support/PanoramaX/Libraries folder.

I’m not sure what you mean. It should already be open. You can access it with the Open View dialog or the View Organizer wizard. However, since it’s a library double clicking on it in the Finder won’t open any windows, so maybe that is what you mean. Basically now it is going to work like all of Panorama’s built in libraries – the only difference is the location.


#6

I’m clearly breaking new ground here. I’m working out how to edit a database containing registered custom statements and it’s not easy. Editing the file while it’s in the Libraries folder doesn’t work and I can see the logic of that. So I dragged the database to the desktop, quit Panorama X and edited it there.

So far, so good but I can’t save it - I get this message:

Pursuing it a little further, I changed the file name, quit Panorama X again and, after opening, editing and saving, got this:

I find it interesting that Panorama X reports the location of a file that doesn’t exist!


#7

You cannot edit these procedures from the Open View dialog? Or using the View Organizer? You are supposed to be able to right in the Libraries folder. If you cannot, what happens when you try?

Any files in ~/Application Support/PanoramaX/Libraries/ are opened automatically as libraries when Panorama starts up. That means that they are secret – no visible windows. I think that is why double clicking doesn’t work – the file is already open with no windows, and library files are supposed to stay secret. But the procedures and forms should be accessible at any time from the Open View dialog (make sure +Libraries is selected) and the View Organizer (make sure Include Libraries is checked).


The document could not be saved
#8

I’m getting very inconsistent results - I make one change and save and it’s Ok. Make a second change and save and it says no such file. I may be complicating it by also having one procedure invoke another as a custom statement so tomorrow I’ll just play with one database and a couple of simple procedures.


#9

I have been trying to get Custom Statements and Custom Functions to work, because I have a very few that I use from Panorama 6, with no luck. I started by having the database made, and then added in the .gettextsheet procedure that Dave shared with us, which works nicely. When I tried registering it as GETTEXTSHEET, there was an error message which flashed briefly on the screen before Panorama X crashed (which it does frequently), something about something that cannot be 0.

So I have tried a number of things to get it to work. I got it briefly to appear as a registered statement, and then it disappeared again after yet another crash.

I just feel that it is not worth my time to waste on problems like this, and so I have been waiting for someone else to test these things, and for things to get simpler. I am just finding that Panorama X is too buggy to spend much time with.


#10

Finally got it to work. Panorama X crashes cause it to lose things that I had explicitly saved.


#11

Well, I’m actually to blame for that little hack.:smirk:


#12

Sorry for the misattribution! I could have looked it up, but I was tired of dealing with all the crashes.


#13

What OS are you using Bruce?


#14

10.12.2. I know there is a conflict somewhere because I have the problem of closing data sheets from the menu crashing Panorama on the account that I usually work from, but not on other accounts with the same system.


#15

Back to the topic of storing and registering custom statements, I find this to be the simplest approach:

Quit Panorama X and drag a database containing custom statements into the /Application Support/PanoramaX/Libraries/ folder. Open any Panorama X database and all of the custom statements are registered.

I can’t get the more complex way of fiddling with the View Organizer to work without quitting and rebooting Panorama X, which is a long way round of doing what I’ve done in the previous paragraph.