Appendix A: System Routines — Variables
1133
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
cmd_delvar
Declaration:
void
cmd_delvar
(EStackIndex
sym
)
Category(ies):
Variables
Description:
Delete one or more variables. This is the TI
-
BASIC command DelVar. As
specified in the Managing Variables section of the Memory Management
chapter, these routines should be used instead of the low-level symbol
table routines.
Inputs:
sym
— EStackIndex of variable name(s) to delete (terminated by an
END_TAG).
Outputs:
May throw these errors:
ER_LOCKED — Variable is locked or in-use.
ER_ARG_CANNOT_BE_FOLDER — Use
cmd_delfold
to delete folders.
ER_RESERVED — Reserved names cannot be
deleted.
Assumptions:
None
Side Effects:
None
Availability:
On AMS 1.05 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: TokenizeSymName
Example:
This example deletes the variable name in
varName.
void DelVar( BYTE *varName ) {
EStackIndex oldTop = top_estack; /* save top of ESTACK */
TRY
push_quantum (END_TAG); /* mark end of parameter list */
if (TokenizeSymName( varName, 0 ) == NULL) /* push tokenized name on ESTACK */
ER_THROW( INVALID_PATHNAME_ERROR );
cmd_delvar(top_estack);
top_estack = oldTop; /* restore top of ESTACK */
ONERR
top_estack = oldTop; /* restore top of ESTACK */
PASS; /* pass error on up to caller */
ENDTRY
}