master/reconstruct/page046.inc

Here is the input file used to remember the OCR text from the page046 page. To contribute corrections, save this web page as text, remove the header and footer, leaving only the monospaced text. After making your corrections, including any HTML markup you think necessary, please email the corrected page to the maintainer.
<!--
        UCSD Pascal System II.0 User Manual
        Copyright (C) 1979 Regents of the University of California

        HTML markup and formatting
        Copyright (C) 2006, 2007, 2010 Peter Miller
-->
<p>
 <#include reconstruct/page "page046" "46">
<blockquote>
<b>Figure 3.8</b>
<hr><pre>PROGRAM STRING1;
BEGIN
  WRITE('TOO WISE 0;
  WRITE('YOU ARE');
  WRITELN(',');          (* <i>Cursor finishes in this line</i> *)
  WRITELN('TOO WISE ');
  WRITELN('YOU BE.')
END.                     (* <i>Cursor starts in this line</i> *)</pre><hr>
</blockquote>
<p>
Example 3: On the first find we type &ldquo;F/WRITE/&rdquo;.  This locates
the first &ldquo;<tt>WRITE</tt>&rdquo;.
Now typing &ldquo;FS&rdquo; will make the prompt line flash:
<blockquote>
<pre>&gt;Find[1]: L)it &lt;target&gt;  =&gt;S</pre>
</blockquote>
and the cursor will appear at the second WRITE.
<p>
<a name="commandr"></a>
<b>Replace</b>
<p>
REPLACE mode is reached by typing &ldquo;R&rdquo; while at the Edit level.
On entering REPLACE mode one of the two prompt lines in Figure 3.9
appears.  In this example, a &lt;repeat-factor&gt; of four is assumed.
<blockquote>
<b>Figure 3.9</b>
<a name="literal.38"></a>
<a name="verify.39"></a>
<a name="token.40"></a>
<hr><pre>&gt;Replace[4]: L(it V(fy &lt;targ&gt; &lt;sub&gt; =&gt;
&gt;Replace[4]: T(ok V(fy &lt;targ&gt; &lt;sub&gt; :&gt;</pre><hr>
</blockquote>
<p>
Example 1: Type &ldquo;RL/QX//YZ/&rdquo; which make the prompt line appear as:
<blockquote>
<pre>&gt;Replace[1]: L)it V)fy &lt;targ&gt; &lt;sub&gt; =&gt;L/QX//YZ/</pre>
</blockquote>
This command will change: &ldquo;<tt>VAR SIZEQX: INTEGER;</tt>&ldquo; to
&ldquo;<tt>VAR SIZEYZ: INTEGER;</tt>&rdquo;.
Literal mode is necessary because the string QX is
not a token but is part of the token <tt>SIZEQX</tt>.
<p>
Example 2: In Token mode REPLACE ignores spaces between tokens
when finding patterns to replace.  For example, using the lines on the
left hand side of Figure 3.10 and typing: &ldquo;2RT/(',')/.LN.&rdquo;
The prompt line should appear as:
<blockquote>
<pre>&gt;Replace: L)it V)fy &lt;targ&gt; &lt;sub&gt; =&gt;/(',')/.LN.</pre>
</blockquote>

The facsimile of this page is available for comparison purposes. Follow this link to see the formatted result.