[Main]
Name=cmd_shade
Type=Function
Header Files=bascmd.h
Definition=void cmd_shade (ESI Args);
Subtype=ROM Call
MinAMS=1.01
See Also=cmd_drawfunc, cmd_drawparm, cmd_drawpol

[ROM Call]
Index=$38A

[Description]
Executes TI-Basic 'Shade' command.

[Explanation]
cmd_shade displays the Graph Screen, graphs two expressions on the screen as
functions using "x" as the independent variable, and shades the areas in
which the first expression is less than the second one (see TI-Basic manual
for more info). This function expects one of the following layouts on the
expression stack:
<BR><BR>
<TABLE BORDER CELLPADDING="2">
  <TR><TD><A HREF="$$LINK(estack.h/Tags)">END_TAG</A> <I>expression_2</I> <I>expression_1</I></TD></TR>
  <TR><TD><A HREF="$$LINK(estack.h/Tags)">END_TAG</A> <I>x_low</I> <I>expression_2</I> <I>expression_1</I></TD></TR>
  <TR><TD><A HREF="$$LINK(estack.h/Tags)">END_TAG</A> <I>x_high</I> <I>x_low</I> <I>expression_2</I> <I>expression_1</I></TD></TR>
  <TR><TD><A HREF="$$LINK(estack.h/Tags)">END_TAG</A> <I>pattern</I> <I>x_high</I> <I>x_low</I> <I>expression_2</I> <I>expression_1</I></TD></TR>
  <TR><TD><A HREF="$$LINK(estack.h/Tags)">END_TAG</A> <I>pat_res</I> <I>pattern</I> <I>x_high</I> <I>x_low</I> <I>expression_2</I> <I>expression_1</I></TD></TR>
</TABLE>
<BR>
Additionally, each of the entries <I>x_low</I>, <I>x_high</I>, <I>pattern</I>,
and <I>pat_res</I> may be omitted and replaced with
<A HREF="$$LINK(estack.h/Tags)">NOTHING_TAG</A>. The parameter <I>Args</I>
should point to the tag of the last item (i.e. <I>expression_1</I>).
<BR><BR>
<I>x_low</I> and <I>x_high</I>, if included, must be floating point or
integer items. They specify the left and right boundaries for the shading
process. Valid values are all real values between the values of TI-Basic
system variables "xmin" and "xmax". Also, "xmin" and "xmax" are defaults for
<I>x_low</I> and <I>x_high</I> if they are omitted.
<BR><BR>
<I>pattern</I> and <I>pat_res</I>, if included, must be integer items.
<I>pattern</I> specifies one of the following four shading patterns:
<BR><BR>
<TABLE BORDER CELLPADDING="4">
<TR><TD VALIGN="TOP">1</TD><TD>Vertical shading [DEFAULT]</TD></TR>
<TR><TD VALIGN="TOP">2</TD><TD>Horizontal shading</TD></TR>
<TR><TD VALIGN="TOP">3</TD><TD>Negative-slope (45 degree) shading</TD></TR>
<TR><TD VALIGN="TOP">4</TD><TD>Positive-slope (45 degree) shading</TD></TR>
</TABLE>
<BR>
<I>pat_res</I> specifies the resolution of the shading patterns:
<BR><BR>
<TABLE BORDER CELLPADDING="4">
<TR><TD VALIGN="TOP">1</TD><TD>Solid shading</TD></TR>
<TR><TD VALIGN="TOP">2</TD><TD>1 pixel spacing [DEFAULT]</TD></TR>
<TR><TD VALIGN="TOP">3</TD><TD>2 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">4</TD><TD>3 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">5</TD><TD>4 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">6</TD><TD>5 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">7</TD><TD>6 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">8</TD><TD>7 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">9</TD><TD>8 pixel spacing</TD></TR>
<TR><TD VALIGN="TOP">10</TD><TD>9 pixel spacing</TD></TR>
</TABLE>
<BR>
Note that the drawn graph is not part of the smart graph feature (see the
TI-Basic manual for more info), and that regraphing will erase all drawn
items.

[References]
Out=error.h/ER_catch, error.h/ER_success, error.h/ER_throwVar, estack.h/GetValue, estack.h/next_expression_index, estack.h/push_expression, estack.h/push_Float, estack.h/push_quantum, estack.h/top_estack, graphing.h/gr_active, system.h/OSCheckBreak, timath.h/is_transfinite, unknown.h/ForceFloat, unknown.h/GraphActivate, unknown.h/GrLineFlt, unknown.h/QSkipGraphErr, unknown.h/XCvtPtoF, unknown.h/YCvtFtoWin, wingraph.h/MakeWinRect, wingraph.h/WinAttr, wingraph.h/WinLine, unknown.h/_bcd_math
Out_EV_eventLoop=1
