NoShow Ends Prematurely


#1

I don’t know if this has been previously reported. If so, sorry for the repeat.

I have a PanX procedure which calls a subroutine which opens a different database. That subroutine is called by a FARCALL statement in the main macro. Here is the subroutine:

Local t1, f1
f1 = parameter(1)   //this is the path and file name
t1 = info("files")
t1 = arraysearch(t1,f1["-:",-1][2,-1],1,¶)
If t1 = 0       ; means file IS NOT already open
    openfile f1
else    //file IS already open
    window f1["-:",-1][2,-1]
    SAVEACOPYAS "TempFile"
    openfile "TempFile"
endif
RTN

If the external database is NOT open, this subroutine opens it. If the external database IS already open, an exact copy of the database is opened instead. In either case, the external database is subsequently closed after certain data has been extracted via an arraybuild statement.

The main macro has a NoShow at the beginning, and an EndNoShow before the last RTN. Both the main macro and the subroutine work perfectly. In both Pan6 and PanX.

However, in PanX, if I run the main macro with the external database already OPEN, the NoShow is prematurely cancelled. I have to watch the entire macro run on-screen (it is a very long macro), and there is no way to stop the macro.

For some reason, saving the external database as “Tempfile” seems to cancel the NoShow. And COMMAND-PERIOD does nothing. When I run the main macro with the external database CLOSED, the NoShow works properly.

This does not happen in Pan6, which works correctly.

Is this a known issue?

Vic


#2

Unlike Pan6, command-period doesn’t stop running procedures in Pan. They run until they’re done absent force quitting PanX. I suppose you can code for situational early stops by checking if some key were down.


#3

Does the database you are opening have an .Initialize procedure? I suspect that might have something to do with this. Even if there is no endnoshow in the .Initialize procedure, Panorama automatically performs an endnoshow when an independent procedure stops running. However, this is a bit puzzling, since you are opening the database either way.

There is nothing in the SaveACopyAs statement’s internal code that should affect the noshow status.

In any case, I would suggest putting the NoShow after the subroutine call. There aren’t any operations in that subroutine that would be affected by NoShow.


#4

No, Jim. There is not a “.initialize” procedure associated with either database - the original or the subroutine database.

I did as you suggested, and added a second NoShow command just before the start of the long loop. That did the trick. The loop action is now hidden either with or without the external database being open.

But here’s something strange. I moved the second NoShow earlier, to the line immediately after the second FARCALL command. The macro worked (there is a message statement just before the macro ends so I know it got that far) BUT PANX CRASHED! I could not click the OK for the message statement, and could not exit the program. Had to do a Force Quit.

It looks like NoShow has some hidden gremlins in the PanX code, Jim.

Vic


#5

Hello Jim,

I must apologize. The macro I described opens TWO external databases, and then closes each of them after extracting data.

The second database opened DOES have a .initialize macro. I wasn’t concentrating on that file, because it was the other external file I had open on the screen when the anomaly occurred.

So you were entirely correct in assuming that the .init had something to do with the NoShow problem.

Of course, the crash problem still remains.

Regards,
Vic