File r37/lisp/csl/html/r37_0233.html artifact c95d8dc1e3 part of check-in 2f3b3fd537



<A NAME=OUT>

<TITLE>OUT</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>OUT</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>command</B><P>
<P>
 
 <P>
<P>
The <em>out</em> command directs output to the filename that is its argument, 
until another <em>out</em> changes the output file, or 
<A HREF=r37_0234.html>shut</A> closes it. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>out</em>&lt;filename&gt; or <em>out &quot;</em>&lt;pathname&gt; <em>&quot;
</em> or <em>out t</em> 
<P>
<P>
<P>
&lt;filename&gt; must be in the current directory, or be a valid complete 
file description for your system. If the file name is not 
in the current directory, quote marks are needed around the file name. 
If the file already exists, a message is printed allowing you to decide 
whether to supersede the contents of the file with new material. 
<P>
<P>
To restore output to the terminal, type <em>out t</em>, or 
<A HREF=r37_0234.html>shut</A> the 
file. When you use <em>out t</em>, the file remains available, and if you 
open it again (with another <em>out</em>), new material is appended rather 
than overwriting. 
<P>
<P>
To write a file using <em>out</em> that can be input at a later time, the 
switch 
<A HREF=r37_0308.html>nat</A> must be turned off, so that the standard linear fo
rm 
is saved that can be read in by 
<A HREF=r37_0231.html>in</A>. If <em>nat</em> is on, exponents 
are printed on the line above the expression, which causes trouble 
when REDUCE tries to read the file. 
<P>
<P>
There is a slight complication if you are using the <em>out</em> command from 
inside a file to create another file. The 
<A HREF=r37_0281.html>echo</A> switch is normally 
off at the top-level and on while reading files (so you can see what is 
being read in). If you create a file using <em>out</em> at the top-level, 
the result lines are printed into the file as you want them. But if you 
create such a file from inside a file, the <em>echo</em> switch is on, and 
every line is echoed, first as you typed it, then as REDUCE parsed it, and 
then once more for the file. Therefore, when you create a file from 
a file, you need to turn <em>echo</em> off explicitly before the <em>out</em> 
command, and turn it back on when you <em>shut</em> the created file, so your 
executing file echoes as it should. This behavior also means that as you 
watch the file execute, you cannot see the lines that are being put into 
the <em>out</em> file. As soon as you turn <em>echo</em> on, you can see 
output again. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]