| cmd_shade | Function (ROM Call 0x38A)

AMS 1.01 or higher | bascmd.h

void cmd_shade (ESI Args);

Executes TI-Basic 'Shade' command.

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:

END_TAG expression_2 expression_1
END_TAG x_low expression_2 expression_1
END_TAG x_high x_low expression_2 expression_1
END_TAG pattern x_high x_low expression_2 expression_1
END_TAG pat_res pattern x_high x_low expression_2 expression_1

Additionally, each of the entries x_low, x_high, pattern, and pat_res may be omitted and replaced with NOTHING_TAG. The parameter Args should point to the tag of the last item (i.e. expression_1).
x_low and x_high, 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 x_low and x_high if they are omitted.
pattern and pat_res, if included, must be integer items. pattern specifies one of the following four shading patterns:

1 | Vertical shading [DEFAULT]
2 | Horizontal shading
3 | Negative-slope (45 degree) shading
4 | Positive-slope (45 degree) shading

pat_res specifies the resolution of the shading patterns:

1 | Solid shading
2 | 1 pixel spacing [DEFAULT]
3 | 2 pixel spacing
4 | 3 pixel spacing
5 | 4 pixel spacing
6 | 5 pixel spacing
7 | 6 pixel spacing
8 | 7 pixel spacing
9 | 8 pixel spacing
10 | 9 pixel spacing

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.

Uses: ER_catch, ER_success, ER_throwVar, GetValue, next_expression_index, push_expression, push_Float, push_quantum, top_estack, gr_active, OSCheckBreak, is_transfinite, ForceFloat, GraphActivate, GrLineFlt, QSkipGraphErr, XCvtPtoF, YCvtFtoWin, MakeWinRect, WinAttr, WinLine, _bcd_math

See also: cmd_drawfunc, cmd_drawparm, cmd_drawpol