OpenFile issue in Pan 6; OpenFile will not open secondary database


#1

I am rather new to Panorama. Please forgive me if this is a silly question. I have looked through the formulas and programming documentation and do not seem to be able to solve this issue.

When I use the openfile statement to open a secondary database (located in the same folder as the first database), focus switches from the open procedure window to the 1st database and nothing happens. The 2nd database does not open and no error message appears. I have tried numerous variations of the openfile and openfiledialog statements and I cannot find a method that will open the 2nd database. I have tried to perform this action with several other databases with no success. I also tried using error handling. Typing the file name with and without the extension does not work. Also, using the nodefaultextension statement does not make this work.

I am running macOS Sierra 10.12.6 with Admin rights and Panorama 6.0.0 Build 121629. I have not experienced any other issues with procedures. The other databases I am trying to open with a procedure will open just fine if I use the Panorama file menu (not the pop-up dialog window) to manually open the database. I just don’t seem to be able to make it happen inside a procedure. What am I missing here?

I am happy to answer any questions that would help diagnose this problem. -Adam


#2

It would help to see the code you’re using. There may be an obvious clue there.

The lack of any error message suggests that it is opening; perhaps off the viewable screen area. Check the Window menu to see if it’s listed.

Otherwise, check spelling and capitalization, and be sure there are no leading or trailing spaces.

But again, post your code for others to review.


#3

Hi James,

Thank you for your response. I have indeed checked under the Windows menu item and the database that should be open is not listed. Here’s a few examples with code plus a screen capture of the folder with database files to show spelling.

1st example:

openfile “Counties.pan”

2nd example:

openfile “Counties”

3rd example - This one I have tried with and without the .pan extension on the saved database file and in the code. I can generate a “File ‘Counties’ not found” message using the code below… but that makes sense. It’s looking for a file with no extension and can’t find it.

nodefaultextension
openfile “Counties”

4th example - This one let’s me select and Choose the database file but nothing happens.

local fileFolder,fileName,fileType
openfiledialog fileFolder,fileName,fileType,“ZEPD"
if fileName=”" stop endif ; user pressed cancel

5th example - Using error checking. It only generates an input field if I purposely mistype “Counties.pan” Otherwise, it seems to execute normally but nothing happens.

local txFileName
txFileName=“Counties.pan"
loop
openfile txFileName
if error
gettext “Enter the file name”,txFileName
reloopif txFileName≠”“
endif
while 1≠1
if txFileName=”" stop endif


#4

Are you absolutely certain that the base file is actually the one that is in the folder with the other files? It is possible that you are inadvertently using a version of that file that is outside the folder you think it is in. Been there, done that!


#5

Is the file you are trying to open in the same folder as the one which triggers the procedure? If not, you may need to define the path to it.

What happens if you double-click the icon for the file in the finder?

Jeff Kozuch
President, Acacia Systems
Panorama Programming and Training
Apple Certified Technical Coordinator
Member, Apple Consultants Network
jk@acaciasystems.com
http://www.acaciasystems.com
562-437-7690


#6

The only way I can find to duplicate these symptoms is for the file I am trying to open to have been saved without windows. Every other scenario I can come up with either opens the file in a visible window, or gives me an error message.

If the file can’t be found, because it’s in a different folder, you get an error saying it can’t be found.

If it has opened without windows it won’t be on the Windows menu, but then opening it from the File menu isn’t going to give it a window either.

You might try looking at Memory Usage (on the Panorama menu) to see if the file appears there. If so, it’s open.


#7

This isn’t an answer to your question, but this code by itself isn’t supposed to open the file. It just gathers the information needed, so that a later statement can open it. The complete procedure would be

local fileFolder,fileName,fileType
openfiledialog fileFolder,fileName,fileType,"ZEPD"
if fileName="" stop endif ; user pressed cancel
openfile folderpath(fileFolder)+fileName

#8

Good thought, but yes, the base file is in the same folder. I’m not using any aliases at all.


#9

Yes, they are all in one folder. If I double click any of the files in the folder containing the databases, the database opens normally.


#10

I don’t believe I’ve saved any of the databases without windows. That assumption is based on the fact that a window such as a form or data sheet opens for every database file when it is double clicked to open.

They do not appear in Memory Usage either unfortunately. This goes for any of the databases. I can open one, write a new procedure to open one of the other databases, and run it. Nothing happens.


#11

Thank you. That was indeed an oversight on my part. Including the last line does allow me to choose another database to open, but with the same effect. It seems to process all the code but do nothing. No additional databases appear in Window menu or in Memory Usage. :confused:


#12

Like David, I was thinking maybe the file was saved with no windows but, if it opens normally when double clicked, it doesn’t seem likely.

Jeff

Jeff Kozuch
President, Acacia Systems
Panorama Programming and Training
Apple Certified Technical Coordinator
Member, Apple Consultants Network
jk@acaciasystems.com
http://www.acaciasystems.com
562-437-7690


#13

Adam, you said, the databases open fine when you use the file menu, but not the “pop-up dialog window”. Don’t know what you mean. Can you open those files when you use cmd-O and using the File Open dialog? Do you see those files active (not greyed out) in that dialog? Otherwise you might have an access rights issue. (Your folder “Registry” is (in your Documents folder) inside your user folder, isn’t it?)

On the other hand, when you are able to open those files via the standard File Open dialog, then the access rights seem to be OK, and we have a problem with the application or with the system.


#14

Sorry for the confusion.

Yes, I can open all of the database files with cmd-O and using File->Open File dialog from within Panorama.

By “pop-up dialog window,” I mean the Finder window that appears upon running code that uses openfiledialog. It is quite odd that one method works while the other does nothing.

This folder “Registry” is on the Desktop. I’ve checked the Sharing & Permissions options for each file using the Info pane. Is there another method for setting permissions that could cause a conflict?


#15

I assume from your previous tests that manually including the full path to the file will not work either:

openfile folderpath(info("desktopfolder"))+"Registry:Counties"

#16

Correct. I have tried several variations on including the full file path in coding as well. Using your example has the same effect… the procedure appears to execute without error, yet the database that should have opened is not open and the window switches focus from procedure window to the original database (the one I manually opened in the first place).


#17

I copied a folder of my files to the desktop. The .initialize procedure in the main database opened other databases successfully; no problems in my test.

So something is really not working on your Mac the way it should. Here are some ideas for troubleshooting in ascending order:

  1. Restart your Mac. Sometimes miracles happen …
  2. Do some maintenance with a tool like OnyX e.g. rebuild dyld’s Shared Cache, clear user caches.
  3. How was your Pan 6 installed on your Sierra system? Migration (usually working well) from an older system or a new installation? Is Panorama installed in its regular location (with all its components in the Panorama folder inside your Applications folder)? Consider a re-installation of Pan 6 (but that has its own issues on Sierra …)
  4. As last resort you could consider to reinstall the last Combo Update of macOS (or the complete system).

#18

Out of curiosity, if you choose a wizard from the Wizards menu, does it open?


#19

Thank you for the suggestions, KJM. I have tried all of your suggestions with the exception of #4; instead, I installed a fresh copy of El Capitan on a second Mac rather than run any OS updates on my Sierra computer. To answer your questions in #3, it is a fresh install of Pan 6 and it is located in the Applications folder.

The openfile issue persisted through a reinstall of Pan 6 on my Sierra computer and was also present on the other Mac with a fresh copy of El Capitan. I have root level permissions on both computers. I am also able to open Wizards without issue (to respond to Dave’s question).

I used a trial of Pan X on my Sierra computer and it was able to use the openfile command without issue on the same files giving me issues in Pan 6.

Further troubleshooting the issue, I created brand new databases and tried using the openfile command and was successful. So, I then used the Save As option on each of my existing databases and stored new copies of them in a new folder. Once the copies were created, I attempted the openfile command AND IT WORKS!

I am quite confused as to what exactly is happening during the “save as” function in order to resolve this issue. Simply duplicating the original folder of databases does not ‘fix’ the files. If I check Memory Usage for the new files, I can see databases I’ve opened that have no windows are indeed running. With the old files, they never appear in Memory Usage and do not cause any error message to appear.

I have redundant backups of my database files in case there is ever an issue, but should there be any cause for concern regarding the integrity of the data held in the new “save as” copies of the database? I will eventually transition the files to Pan X once it comes out of beta but I do want to make sure I’m not introducing integrity issues within the current set of files.

Thanks again to everyone who has offered suggestions and asked questions to help me sort out this issue.


#20

I think this is very unlikely. You probably are an admin user.

If you are a root level user, that means that you have completely turned off the permissions on your system. That is possible, but Apple discourages doing this except perhaps for a short, specific task.

If you duplicate a folder in the Finder, that will not only duplicate the contents of the file, but also any metadata, including permissions and extended attributes.

When you do a Save As, Panorama creates a new file. So the contents of the file are duplicated, but not the metadata.

I think you have some sort of problem with the metadata for the files that are causing you problems. Perhaps a permissions problem. You might be able to clear this up with Get Info or with Terminal.app.

The puzzle is that you don’t see an error message when you try to open the file. Perhaps the problem is one that trips up the old Carbon API’s that Panorama 6 uses, but that Carbon doesn’t report as an error properly.

It’s also possible that there is a metadata problem with the folder. I’ve never seen the problem you describe, but I have run into problems with other programs where files could not be accessed because of permission issues on the enclosing folder.

No, nothing to worry about. Clearly the content of the files are fine. Using Save As to a new folder is an excellent approach to leaving behind metadata problems in existing files.