A common misconception is that a secret window is an entity, like regular windows but not visible (this misconception is my fault, as I’ll explain). However, that isn’t really true. There is no such thing as a secret window. The info(“windowname”) function will ALWAYS return the name of the topmost visible window, it will never return the name of a secret window, because there is no such thing as a secret window. All there is is an internal variable that tells Panorama to use an alternate database instead of the database that is associated with the topmost visible window. If you use the info(“databasename”) function instead, you will see that the specified “secret” database is listed.
In this case, that is because of the message statement! If you take that out, the selection will work. Here’s why – any time you do anything that changes the window configuration, Panorama clears out the internal variable that tells it to use an alternate “secret” database, and it resumes it’s normal operation of assuming that the active database is the one belonging to the topmost visible window. When the message statement is used, that opens an alert window, which is a change in window configuration. Lesson to learn – don’t use the message statement when you are using “secret” windows.
When you use a statement like:
Panorama handles that as a special case. It is not actually creating an invisible window, rather, it just notes the word “secret” on the end, and sets the active database to CCMASTERFILE. It’s kind of a parlour trick. But as a trick, it is confusing. That’s why in Panorama X I added the setactivedatabase statement. The statement
does EXACTLY the same thing as the window statement example above, but it’s up front about it, no trick. That’s why I recommend using setactivedatabase instead of window “database:secret” – both do the same thing, but * setactivedatabase is up front instead of tricky about what is really going on.