Texas Instruments TI-89 Developer's Manual page 1128

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

1086
get_key_ptr
Example:
/* The system only uses get_key_ptr after user variables, arbitrary constants, and
numbers have been processed. If i is the EStackIndex of an expression, and kp is
an unsigned char pointer, then the following is an appropriate approach. */
Quantum q, r;
q = ESTACK (i);
/* get the topmost tag */
r = 0;
/* assume the topmost tag is a primary tag */
if (IS_USER_VAR (q))
{
. . . /* code to handle user variables */
}
else if (IS_ARB_TAG (q))
{
. . . /* code to handle arbitrary constants, @1, @n1, etc. */
}
else if (IS_NUMBER_TAG (q))
{
. . . /* code to handle numbers */
}
else if (IS_DOUBLE_TAG (q))
{
r = ESTACK (i - 1);
}
kp = get_key_ptr (q, r);
.
.
.
/* -------------------------------------------------------------------- */
/* if q = SIN_TAG and r = 0, then get_key_ptr (q, r) returns a pointer
/* to the string "sin(".
/*
/* if q = SYSVAR_TAG and r = SV_XMIN, then get_key_ptr (q, r) returns a */
/* pointer to the string "xmin".
/*
/* if q = SECONDARY_TAG and r = GETKEY_TAG, then get_key_ptr (q, r)
/* returns a pointer to the string "getkey()".
/* -------------------------------------------------------------------- */
TI-89 / TI-92 Plus Developer Guide
Appendix A: System Routines — Token Operations
(continued)
/* check for user variables */
/* check for arbitrary constants */
/* check for numbers */
/* check for tokens that require two values */
/* SYSVAR_TAG, SECONDARY_TAG, COMMAND_TAG */
/* get pointer to catalog string */
Not for Distribution
*/
*/
*/
*/
*/
*/
*/
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents