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:

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

pat_res specifies the resolution of the shading patterns:

1Solid shading
21 pixel spacing [DEFAULT]
32 pixel spacing
43 pixel spacing
54 pixel spacing
65 pixel spacing
76 pixel spacing
87 pixel spacing
98 pixel spacing
109 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