1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Paging Screen Output (GNU Octave (version 10.3.0))</title>
<meta name="description" content="Paging Screen Output (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Paging Screen Output (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Terminal-Output.html" rel="up" title="Terminal Output">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<div class="subsubsection-level-extent" id="Paging-Screen-Output">
<div class="nav-panel">
<p>
Up: <a href="Terminal-Output.html" accesskey="u" rel="up">Terminal Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsubsection" id="Paging-Screen-Output-1"><span>14.1.1.1 Paging Screen Output<a class="copiable-link" href="#Paging-Screen-Output-1"> ¶</a></span></h4>
<p>When running interactively, Octave normally sends all output directly to the
Command Window. However, when using the CLI version of Octave this can create
a problem because large volumes of data will stream by before you can read
them. In such cases, it is better to use a paging program such as <code class="code">less</code>
or <code class="code">more</code> which displays just one screenful at a time. With <code class="code">less</code>
(and some versions of <code class="code">more</code>) you can also scan forward and backward, and
search for specific items. The pager is enabled by the command <code class="code">more on</code>.
</p>
<p>Normally, no output is displayed by the pager until just before Octave is ready
to print the top level prompt, or read from the standard input (for example, by
using the <code class="code">fscanf</code> or <code class="code">scanf</code> functions). This means that there may
be some delay before any output appears on your screen if you have asked Octave
to perform a significant amount of work with a single command statement. The
function <code class="code">fflush</code> may be used to force output to be sent to the pager (or
any other stream) immediately.
</p>
<p>You can select the program to run as the pager with the <code class="code">PAGER</code> function,
and configure the pager itself with the <code class="code">PAGER_FLAGS</code> function.
</p>
<a class="anchor" id="XREFmore"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-more"><span><strong class="def-name">more</strong><a class="copiable-link" href="#index-more"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-more-1"><span><strong class="def-name">more</strong> <code class="def-code-arguments">on</code><a class="copiable-link" href="#index-more-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-more-2"><span><strong class="def-name">more</strong> <code class="def-code-arguments">off</code><a class="copiable-link" href="#index-more-2"> ¶</a></span></dt>
<dd><p>Turn output pagination on or off.
</p>
<p>Without an argument, <code class="code">more</code> toggles the current state.
</p>
<p>The current state can be determined via <code class="code">page_screen_output</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFpage_005fscreen_005foutput">page_screen_output</a>, <a class="ref" href="#XREFpage_005foutput_005fimmediately">page_output_immediately</a>, <a class="ref" href="#XREFPAGER">PAGER</a>, <a class="ref" href="#XREFPAGER_005fFLAGS">PAGER_FLAGS</a>.
</p></dd></dl>
<a class="anchor" id="XREFPAGER"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-PAGER"><span><code class="def-type"><var class="var">val</var> =</code> <strong class="def-name">PAGER</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-PAGER"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-PAGER-1"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">PAGER</strong> <code class="def-code-arguments">(<var class="var">new_val</var>)</code><a class="copiable-link" href="#index-PAGER-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-PAGER-2"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">PAGER</strong> <code class="def-code-arguments">(<var class="var">new_val</var>, "local")</code><a class="copiable-link" href="#index-PAGER-2"> ¶</a></span></dt>
<dd><p>Query or set the internal variable that specifies the program to use
to display terminal output on your system.
</p>
<p>The default value is normally <code class="code">"less"</code>, <code class="code">"more"</code>, or
<code class="code">"pg"</code>, depending on what programs are installed on your system.
See <a class="xref" href="Installation.html">Installing Octave</a>.
</p>
<p>When called from inside a function with the <code class="code">"local"</code> option, the
variable is changed locally for the function and any subroutines it calls.
The original variable value is restored when exiting the function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFPAGER_005fFLAGS">PAGER_FLAGS</a>, <a class="ref" href="#XREFpage_005foutput_005fimmediately">page_output_immediately</a>, <a class="ref" href="#XREFmore">more</a>, <a class="ref" href="#XREFpage_005fscreen_005foutput">page_screen_output</a>.
</p></dd></dl>
<a class="anchor" id="XREFPAGER_005fFLAGS"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-PAGER_005fFLAGS"><span><code class="def-type"><var class="var">val</var> =</code> <strong class="def-name">PAGER_FLAGS</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-PAGER_005fFLAGS"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-PAGER_005fFLAGS-1"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">PAGER_FLAGS</strong> <code class="def-code-arguments">(<var class="var">new_val</var>)</code><a class="copiable-link" href="#index-PAGER_005fFLAGS-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-PAGER_005fFLAGS-2"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">PAGER_FLAGS</strong> <code class="def-code-arguments">(<var class="var">new_val</var>, "local")</code><a class="copiable-link" href="#index-PAGER_005fFLAGS-2"> ¶</a></span></dt>
<dd><p>Query or set the internal variable that specifies the options to pass
to the pager.
</p>
<p>When called from inside a function with the <code class="code">"local"</code> option, the
variable is changed locally for the function and any subroutines it calls.
The original variable value is restored when exiting the function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFPAGER">PAGER</a>, <a class="ref" href="#XREFmore">more</a>, <a class="ref" href="#XREFpage_005fscreen_005foutput">page_screen_output</a>, <a class="ref" href="#XREFpage_005foutput_005fimmediately">page_output_immediately</a>.
</p></dd></dl>
<a class="anchor" id="XREFpage_005fscreen_005foutput"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-page_005fscreen_005foutput"><span><code class="def-type"><var class="var">val</var> =</code> <strong class="def-name">page_screen_output</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-page_005fscreen_005foutput"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-page_005fscreen_005foutput-1"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">page_screen_output</strong> <code class="def-code-arguments">(<var class="var">new_val</var>)</code><a class="copiable-link" href="#index-page_005fscreen_005foutput-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-page_005fscreen_005foutput-2"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">page_screen_output</strong> <code class="def-code-arguments">(<var class="var">new_val</var>, "local")</code><a class="copiable-link" href="#index-page_005fscreen_005foutput-2"> ¶</a></span></dt>
<dd><p>Query or set the internal variable that controls whether output intended
for the terminal window that is longer than one page is sent through a
pager.
</p>
<p>This allows you to view one screenful at a time. Some pagers
(such as <code class="code">less</code>—see <a class="pxref" href="Installation.html">Installing Octave</a>) are also capable of moving
backward on the output.
</p>
<p>When called from inside a function with the <code class="code">"local"</code> option, the
variable is changed locally for the function and any subroutines it calls.
The original variable value is restored when exiting the function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFmore">more</a>, <a class="ref" href="#XREFpage_005foutput_005fimmediately">page_output_immediately</a>, <a class="ref" href="#XREFPAGER">PAGER</a>, <a class="ref" href="#XREFPAGER_005fFLAGS">PAGER_FLAGS</a>.
</p></dd></dl>
<a class="anchor" id="XREFpage_005foutput_005fimmediately"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-page_005foutput_005fimmediately"><span><code class="def-type"><var class="var">val</var> =</code> <strong class="def-name">page_output_immediately</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-page_005foutput_005fimmediately"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-page_005foutput_005fimmediately-1"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">page_output_immediately</strong> <code class="def-code-arguments">(<var class="var">new_val</var>)</code><a class="copiable-link" href="#index-page_005foutput_005fimmediately-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-page_005foutput_005fimmediately-2"><span><code class="def-type"><var class="var">old_val</var> =</code> <strong class="def-name">page_output_immediately</strong> <code class="def-code-arguments">(<var class="var">new_val</var>, "local")</code><a class="copiable-link" href="#index-page_005foutput_005fimmediately-2"> ¶</a></span></dt>
<dd><p>Query or set the internal variable that controls whether Octave sends
output to the pager as soon as it is available.
</p>
<p>When the value is <code class="code">false</code>, Octave buffers its output and waits until just
before the prompt is printed to flush it to the pager. This is the default.
</p>
<p>When <code class="code">page_screen_output</code> is <code class="code">false</code>, this variable has no effect.
</p>
<p>When called from inside a function with the <code class="code">"local"</code> option, the
variable is changed locally for the function and any subroutines it calls.
The original variable value is restored when exiting the function.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFpage_005fscreen_005foutput">page_screen_output</a>, <a class="ref" href="#XREFmore">more</a>, <a class="ref" href="#XREFPAGER">PAGER</a>, <a class="ref" href="#XREFPAGER_005fFLAGS">PAGER_FLAGS</a>.
</p></dd></dl>
<a class="anchor" id="XREFfflush"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-fflush"><span><code class="def-type"><var class="var">status</var> =</code> <strong class="def-name">fflush</strong> <code class="def-code-arguments">(<var class="var">fid</var>)</code><a class="copiable-link" href="#index-fflush"> ¶</a></span></dt>
<dd><p>Flush output to file descriptor <var class="var">fid</var>.
</p>
<p><code class="code">fflush</code> returns 0 on success and an OS dependent error value
(−1 on Unix) on error.
</p>
<p>Programming Note: Flushing is useful for ensuring that all pending output
makes it to the screen before some other event occurs. For example, it is
always a good idea to flush the standard output stream before calling
<code class="code">input</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Opening-and-Closing-Files.html#XREFfopen">fopen</a>, <a class="ref" href="Opening-and-Closing-Files.html#XREFfclose">fclose</a>.
</p></dd></dl>
</div>
<hr>
<div class="nav-panel">
<p>
Up: <a href="Terminal-Output.html">Terminal Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|