1040
Appendix A: System Routines — Symbol Table Utilities
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
SymFindMain
(continued)
Example:
This example walks through all of the Yn functions and displays them as
text in a dialog box.
int i, Skip;
BYTE buf[6];
HANDLE hVal, hText;
HSYM hsym;
SYM_ENTRY *SymPtr;
EStackIndex esi;
for (i=1; i<=99; i++) {
Skip = sprintf( (char *) buf, "%cy%d", 0, i );
if (hsym = SymFindMain( (BYTE *) (buf + Skip) )) {
SymPtr = DerefSym( hsym );
if (hVal = SymPtr->hVal) {
esi = HToESI( hVal );
/* Normally would check the tag *esi but Yn are always functions and are
always tokenized so do not need to check the FF_PARSE flag *(esi-1)
either. */
HeapLock( hVal );
TRY
hText = display_statements( GetFuncPrgmBodyPtr( esi ), FALSE, TRUE );
FINALLY
HeapUnlock( hVal ); /* This always gets executed even if an error is
thrown. Any errors will be passed on up to our
caller. */
ENDFINAL
HeapLock( hText );
DlgNotice( (char *) buf+1, (char *) (HeapDeref(hText)) );
HeapFree( hText );
}
}
}