Info("files") shows file open but it's not listed in Menu->Window

This statement

openfile IntermediateDbPath + "IRAStats"

opens the file and it immediately disappears. Following it with an info("files") statement gives this:

Screen Shot 2022-01-23 at 10.18.01 am

but Menu->Window displays this:

Screen Shot 2022-01-23 at 10.18.14 am

where the IRAStats file is not listed. Is there any explanation for this? The IRAStats database has no procedures or forms.

If there is no window open, it is not going to show up in the Windows menu. Do you have a MakeSecret command in .Initialize or someplace?

There is no .Initialize procedure and no makesecret statement anywhere.

My openfile statement seeks a file named “IRAStats” but the file is actually named IraStats, as you can see above. But then, why does it show as an open file? It hasn’t been opened anywhere else in the procedure. Back to the drawing board.

Unless you’ve set your computer up in a very unusual way, the Finder does not care about upper vs. lower case. I just verified that I can use the openfile statement with a all lower case filename even though in the Finder the filename has upper case letters. It works just fine.

Some questions.

  1. Does this database show up in the Memory Usage window? If so, can you right click on it and open the data sheet?
  2. Can you open this database by double clicking on it from the Finder.
  3. Does “opens the file and it immediately disappears” mean nothing happens? Or does the data sheet momentarily appear then disappear?
  4. If you don’t have any database windows open, how do you know there is no procedure?

Michael, info(“files”) , I could have used this today, thanks for the heads-up.

Well, that’s interesting!

Re your questions:

The file doesn’t show in Memory usage.

I can open it with a double click and then close it normally.

When it’s supposed to open something certainly happens - the screen flickers as if a window had opened and immediately closed but it’s all so fast that I can’t see any file names.

My reference to no procedures resulted from a visual inspection after opening the file manually.

I’ve encountered so many problems with this procedure that I’m building it again from scratch.

That’s very weird – the Memory Usage window uses info(“files”) to generate the list it displays.

I think you must have some sort of code that immediately closes the window. Could you possibly have multiple copies of the IRAStats database?

How about trying this:

opensecret IntermediateDbPath + "IRAStats"
activedatabase "IRAStats"

You can say that again! The procedure imports six .csv files, sets a stack of field properties in each of them and then attempts to merge three of them which have identical structures. That’s the stage at which things go wrong - openfile doesn’t open files, databases are visible but not recognised and can’t be closed, random crashes and more.

In desperation, I broke the procedure into two - one which imports and sets properties and one which does the merging. And they work perfectly - no change of code other than repeating some variable declarations and folder path definitions. It’s as if the first part of the process has interfered with Panorama’s innards.

I’m happy to have it working but very puzzled as to why it is. I’ll try commenting out chunks of code in hope of finding the answer.

This code (in the composite procedure) seems to be the source of the problem:

 let lvArray = "JointStats,RothStats"
looparray lvArray,",",fileName
    openfile IntermediateDbPath + fileName
                                                        message fileName
    field 2
    insertfield "account"
    window windowName
    importdatabase fileName
    field 2 emptyfill fileName[1,-6] 

All variables have been declared and values have been assigned. The message statement is executed for the first element of the lvArray but the procedure stops with AccountStats in front and frozen (it is summoned by the window statement) - I have to quit. I had commented out all but the most basic code and it made no difference.

But the identical code runs perfectly in the two-procedure model.

I’ll try putting the procedures into a new database and see if that helps.

That made no difference.