Announcement

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

  • Bug in "set more"?

    On Stata 15.1/MP

    Code:
    . set more off
    
    . set pagesize 2
    
    . set more 99
    
    . disp "`c(more)'"
    off
    
    --more--
    More generally, setting more to 2-30000 shows more is off but still pauses (i.e. stata behaves as it if was on). "set more 0" seems equivalent to "set more on" and "set more 1" seems equivalent to "set more off". Anything greater than 30000 says that's the limit:

    Code:
    . set more  300001
    more must be between 0 and 30000
    r(198);

  • #2
    -help set more- does not show that a number can be part of the command, just on/off, so I'd say that the error messages are indeed buggy.

    Comment


    • #3
      Well, on my system it's not just the error messages. Setting "more" to a number has an effect, which is not documented either, and it looks like "c(more)" does not accurately reflect the "more" status when set to numbers other than 0 or 1.

      Comment


      • #4
        It sounds like you are expecting more to behave like sleep?
        More doenst make Stata pause, it makes it wait for user input.
        More on/off works, so it does what it says on the box, I'd say. Not a bug, just funny.

        Comment


        • #5
          Originally posted by Jorrit Gosens View Post
          [...]
          More on/off works, so it does what it says on the box, I'd say. Not a bug, just funny.
          I agree with Jorrit Gosens: As -set more- behaves exactly as documented, I would rather say this is (additional) behavior of -set more- that seems "not documented" (as opposed to "undocumented", which, in Stata terms, means "not documented in the manuals, but the online help").

          How did you come to setting more to a number in the first place?

          Regards
          Bela

          Comment


          • #6
            Originally posted by Jorrit Gosens View Post
            It sounds like you are expecting more to behave like sleep?
            More doenst make Stata pause, it makes it wait for user input.
            More on/off works, so it does what it says on the box, I'd say. Not a bug, just funny.
            I'm not confused about what more is supposed to do... Perhaps I have not explained the issue adequately. See remarks below.

            Originally posted by Daniel Bela View Post
            How did you come to setting more to a number in the first place?
            Quick background: A friend of mine ran "set more off", and he incorrectly assumed that after that "set more 1" would have the combined effect of

            Code:
            set more on
            set pagesize 1
            I thought "set more 1" would just throw an error but he remarked that "more was still off." That is when I was surprised to discover that "set more" takes as input numbers from 0 to 30000. The behavior of "set more 0" and "set more 1" is confusing but I agree that it is closer to "not documented", since they just have the same effect as "on" and "off". I would maintain that it should either be documented or not allowed, but alas.

            However, the behavior of "set more 2" through "set more 30000" I do contend is a bug: This has the effect of "set more on" but "`c(more)'" is left off. This is a potential problem when developing applications for Stata that rely on the state of "c()" variables (as my friend was doing, and as I have done).

            Comment


            • #7
              This is a side-effect of a very old syntax of set more.

              The syntax of more long ago was
              set more #
              where # could be set to '0' for on, '1', for off, as well as any other number from 2 to 30,000. # was actually something called "more time". For # > 1, Stata would pause # seconds, showing --more--, and then automatically clear that more and continue. Thus, 2 to 30,000 could be thought of as both 'on' and 'off' as they would show --more-- but would also automatically clear it.

              The above behavior currently only persists in console Stata under Linux.

              We will change c(more) in a future update to return "on" if set more has been passed a number between 2 and 30,000.

              Comment


              • #8
                Originally posted by Alan Riley (StataCorp) View Post
                This is a side-effect of a very old syntax of set more.
                We will change c(more) in a future update to return "on" if set more has been passed a number between 2 and 30,000.
                Thank you; I think this is reasonable.

                Comment


                • #9
                  Originally posted by Alan Riley (StataCorp) View Post
                  This is a side-effect of a very old syntax of set more.

                  The syntax of more long ago was
                  set more #
                  where # could be set to '0' for on, '1', for off, as well as any other number from 2 to 30,000. # was actually something called "more time". For # > 1, Stata would pause # seconds, showing --more--, and then automatically clear that more and continue. Thus, 2 to 30,000 could be thought of as both 'on' and 'off' as they would show --more-- but would also automatically clear it.

                  The above behavior currently only persists in console Stata under Linux.
                  Will this behavior persist? I had not noticed, but If I "set more #", as you say, it is as if I pressed enter every # seconds. In effect, pausing Stata for # * lines / c(pagesize) seconds.

                  Comment

                  Working...
                  X