I'm trying to use -more- to force a pause between display commands in a loop. Here is the code:

Code:
set more on
forvalues x = 1/5{
    di `x'
    more
}
When I run this in the command line, it works as I would expect it to - each number is displayed, followed by --more--. Upon pressing any key, the next number is displayed followed by --more-- and so on.

When run from a do-file, however, all 5 numbers are displayed instantly without --more-- breaks or pauses for user input. I checked if -more- was still set to on throughout the loop using this code:

Code:
set more on
forvalues x = 1/5{
    di `x'
    di `"`c(more)'"'
    more
}
Which outputs:

Code:
1
on
2
on
3
on
4
on
5
on
But again, without any --more-- messages or waiting for user input.

Am I misunderstanding how the command is supposed to work or misusing it somehow?

I'm running Stata/SE 16.1 on Windows 10.