Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inexplicable 'display not found' error on exiting a Stata program

    The error occurs when Stata encounters the `end' command that terminates a quite complex ado file, midway down a nested hierarchy of ado files. There is no variable or program called 'display' and the program has not recently issued a display command. When first encountered, there was a syntax error that might have caused the problem but I corrected that error and the problem persisted, even after quitting Stata and re-running the ado files. A previous incarnation of this package of programs worked fine but I evidently changed something critical when rewriting the package to improve its efficiency. Any suggestions gratefully received.

  • #2
    Originally posted by Mark Franklin View Post
    . . . I evidently changed something critical when rewriting the package to improve its efficiency. Any suggestions gratefully received.
    Starting just before the point where you began making the changes to the code that give rise to this error, insert two new lines
    Code:
    set tracedepth 1
    set trace on
    in order to get an idea of the location where the error occurs. If you don't see what line caused the error (and you'll probably not, given the high level), then move the two new lines closer to called ado-file or section of code where the error arises, and change the first line to
    Code:
    set tracedepth 2
    or even
    Code:
    set tracedepth 3
    and continue narrowing down the location of the offending line(s) of code.

    You can also do a blunt-force approach: set the trace depth high at the beginning and set the trace on before calling the entire package. You can hone in on the problem faster, but it's liable to be daunting to pore through the voluminous output.

    Comment


    • #3
      In your rewriting to improve efficiency, did you port some previous Stata code to Mata? If so, might you have forgotten double quotation marks around arguments to a callback function, for example
      Code:
      stata(display)
      which gives a "display not found" error message.

      Comment


      • #4
        Joseph Coveney's suggestions still stand.

        Otherwise https://www.statalist.org/forums/for...ound-error-111 appears to be essentially the same question.

        Comment

        Working...
        X