Appendix A: System Routines — Data Utilities
339
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
GetDataType
Declaration:
short
GetDataType
(EStackIndex
i
)
Category(ies):
Data Utilities
Description:
Given a pointer to the data tag for a variable, return the data type value (as
defined in Outputs).
Inputs:
i
— Pointer to a tag.
Outputs:
AMS data type value: SDT_ASM, SDT_DATA, SDT_EXPR, SDT_FIG,
SDT_FUNC, SDT_GDB, SDT_LIST, SDT_MAC, SDT_MAT, SDT_MAT,
SDT_OTH, SDT_PIC, SDT_PRGM, SDT_STR, SDT_TEXT.
Assumptions:
None
Side Effects:
None
Availability:
On AMS 2.00 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: DataTypeNames, SmapTypeStrings
Example:
/* Given a pointer to a variable name (CAS format, points to zero byte terminator),
return that variable’s type in the SDT_ASM . . . SDT_TEXT format.
Return –1 if variable not found or has no value.
*/
short getVarType( BYTE *varNamePtr ) {
HSYM hsym;
SYM_ENTRY *SymPtr;
HANDLE h;
if (hsym = VarRecall( varNamePtr, 0)) {
SymPtr = DerefSym( hsym );
if (h = SymPtr->hVal)
return( GetDataType( HToESI(h) ));
}
return –1;
}