Appendix A: System Routines — Symbol Table Utilities
1013
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
FolderAdd
(continued)
Example:
This example creates a temporary folder, adds a locked symbol to it,
dumps the symbol table to the link port (see
HeapWalk
), looks up the
same symbol just added and finally deletes the temporary folder which
deletes everything in the folder including the locked symbol.
BYTE foldName[] = {0,'9','0','0','0',0};
BYTE symName[] = {0,'s','y','m','1',0};
HSYM hsym1, hsym2;
if (FolderFind(foldName+5) == FL_NOTFOUND)
if( !FolderAdd( foldName+5 ))
ER_throw( ER_MEMORY );
hsym1 = AddSymToFolder( symName+5, foldName+5 );
DerefSym(hsym1)->Flags |= SF_LOCK; /* to show FolderDel will still delete it */
HeapWalk( H_WALK_SYM ); /* dump symbol table to link port */
/* lookup same symbol we just added */
hsym2 = FindSymInFolder( symName+5, foldName+5 );
/* HSYMs better match! */
if (hsym1 != hsym2)
ER_THROW( FIRST_INTERNAL_ERR );
FolderDel( foldName+5, FALSE );
HeapWalk( H_WALK_SYM ); /* our temporary folder should now be gone */