Appendix A: System Routines — Symbol Table Utilities
1023
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
HSymDel
(continued)
Example:
/* Clear the single letter variables (A . . . Z) in the current folder and
return the number that could not be deleted.
*/
short clearAtoZ( void )
{ HSYM hSym;
SYM_ENTRY *pSym;
short nLeft;
BYTE symbol[] = {0, 0, 0};
for (nLeft=26, symbol[1] = 'a'; symbol[1] <= 'z'; symbol[1]++) {
if (H_NULL == (hSym = SymFind(symbol+2))) /* lookup var in current folder */
nLeft--; /* not found if HSYM is NULL */
else {
pSym = DerefSym(hSym); /* HSymDel does not check LOCKED, IN-USE flags */
if ((pSym->Flags & (SF_LOCK|SF_INUSE)) == 0) {
TRY
HSymDel(hSym); /* delete it */
nLeft--;
ONERR
ENDTRY
}
}
}
return nLeft;
}