Close and reopen a database creates a (null) database name


#1

I wanted to know if, with just one database open, I could close it (leaving no databases open) and then open it again. I can but the result is that all existing and new forms and procedures appear to belong to a database called (null). Is this expected behaviour?

58%20am


How to name a new file created with the newdatabase statement?
#2

How did you close it and then open it again? I don’t understand what you did. Was this a database you had never saved? If so, how did you manage to get it to open again?


#3

I did this:

closefile
openfile "v"

and it closed and reopened. Now, however, when I try to use the View menu, Panorama X crashes, rather than opening a (null) item as before. I’m experiencing lots of strange and inconsistent behaviour from Panorama X, as you might have guessed from some of my posts.

Another one is:

openform "ReadMe"
print ""
message info("dialogtrigger") 

flashes the message on and off if I click Print but does nothing if I click Cancel. I can’t get anything else to work after a print statement - it’s as if it’s acting as a Stop statement.

In the last six months, I have bought two new iMacs and a MacBookPro in the hope of getting Panorama X to run smoothly. So far, only the MacBook does it reliably - presumably because it has no other apps on it.


#4

Based on my understanding with previous iterations of Panorama, a procedure can’t run after the database containing it has been closed. On Panorama 6 I found a way around that, so for your scenario I’d have used:

Global ExecuteASAP
ExecuteASAP = { ExecuteASAP = “”
OpenFile “}+dbpath()+dbname()+{”}
CloseFile
Stop

As a global, my procedure remained in memory after the database was closed and reliably ran.

Panorama X has StartTimer instead, but after a bit of effort this AM I’ve been unable to construct a similar process and result with it.


#5

Actually the procedure will continue to run to completion after the file containing it is closed. This is true for both Pan 6 and X. Here is the code I used as a test in Panorama X:

closefile
message info("files") // will return remaining open file names if any
message info("procedurename") // returns the name of this procedure
message "Goodbye!"

I eliminated the line with “message info(“procedurename”)” in Panorama 6 since this is not available in that version.


#6

Gary is correct, a procedure will continue to run even if the database containing it closes. However, you obviously cannot start a procedure contained in a closed database.

Was the database named v? Were there any other databases open? If so, were they in the same folder as the database you just closed.

On it’s own, Panorama does not have any concept of of a current folder. Each database file is of course associated with a folder, but once that database is closed, Panorama knows nothing about that folder. Once you use the closefile statement, you cannot rely on what the current folder might be, unless for some reason you know that some particular database will be current.

Your code:

closefile
openfile "v"

is not reliable, because you haven’t specified a full path in the openfile statement.

That said, your original screenshot definitely shows a bug. The filename should never be (null). What we don’t know is what the steps really were to get you to that point.


#7

In all of these tests, only the database named “v” was open - no others anywhere.

Nevertheless, it did indeed open the database, “v”. That database was stable for manipulations in the data sheet but Panorama X crashed when I tried to access one of its procedures or forms.

The steps taken to get to that point were identical with those described herein for database “v”. As I’ve said above, Panorama X is often inconsistent on my iMac - I can occasionally do the same thing twice and get different results (Einstein’s warning notwithstanding).