Inexplicable 'Display not found' (error 111). The error originally occurred when exiting an ado file that is the second in a hierarchy of three nested adofiles, but only after returning from the third ado file, thus: A.ado–>B.ado–>C.ado<>B.ado (where –> is a call and <> is a return). So the problem originally occurred at the end of B after returning from C. Curiously, when I comment-out all 'display' commands that will have been encountered in A, B or C prior to the error, the error then occurs at the end of C before returning to B. I have no variables or program named 'display'; the problem also occurs if I insert an 'exit' command (in which case it happens when that command is reached); also when I prefix the 'end' or 'exit' commands with 'capture'. Program flow is quite convoluted, with much use of preserve, restore, and tempfiles (I tried using frames but those were slower because of restrictions on the types of merge that frames permit). A less convoluted version worked fine but I have been trying to improve program efficiency (which has indeed improved by an order of magnitude). I already redesigned the program structure a couple of times so as to overcome earlier equally inexplicable problems. But I have not been able to find a way around this one, which happens after all the heavy lifting has been done. If I pause execution prior to the error and then BREAK back to Stata the results that have been saved by then are exactly what I want, so this last-minute glitch is very frustrating. Any suggestions gratefully received.
(I should have mentioned thatI am using Stata/MP 16.1 for Mac (Intel 64-bit) Revision 13 Jun 2023.)
(I should have mentioned thatI am using Stata/MP 16.1 for Mac (Intel 64-bit) Revision 13 Jun 2023.)
Comment