Appendix A: System Routines — Variables
1129
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
checkCurrent
Declaration:
HSYM checkCurrent (EStackIndex
symName
, BYTE
tag
)
Category(ies):
Variables, Data Utilities
Description:
Make sure the given symbol exists and matches the requested tag type.
Inputs:
symName
— Indexes the symbol name to check (points to the zero byte
terminator).
tag
— Requested tag type.
Outputs:
HSYM of the symbol table entry if it exists and matches the requested tag
type, otherwise returns H_NULL.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also: VarRecall, TokenizeSymName
Example:
The text editor when it is told to edit the current text variable uses
checkCurrent
to make sure the previous name entered by the user still
exists and is a text variable. If it is not then it falls through to the code to
prompt the user for a new text variable to edit.
static EStackIndex curTextNameSym;
HSYM hSym;
.
.
.
case AP_START_CURRENT:
// Does current text exist?
hSym = checkCurrent(curTextNameSym, TEXT_VAR_TAG);
if (hSym != H_NULL) /* text exist? */
break; /* yes, open existing text ---> */
// Fall through to open new text
case AP_START_NEW:
// Prompt for new text name
hSym = VarNew((BYTE *)types);