Appendix A: System Routines — Symbol Table Utilities
1027
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_setfold
(continued)
Example:
(continued)
/* Prompt the user for a folder name and set that to the current default folder.
If the user enters nothing or an invalid name, reprompt this time with the
current folder. Return TRUE if valid name entered, FALSE otherwise.
*/
{
BYTE szBuf[SYM_LEN+2], *ptr;
EStackIndex oldTop = top_estack;
memset( szBuf, 0, SYM_LEN+1 );
redo:
TRY
if (KB_ENTER == Dialog( &dGetFold,-1,-1, (char *) szBuf, NULL)) {
ptr = FirstNonblank((BYTE *) szBuf);
if (*ptr == '\0') {
redo2:
push_getfold();
/* Pushed on estack: 0, cur_fold, 0, STR_DATA_TAG. So we start at the
last char of cur_fold and find the starting char (going from high to
low memory) */
ptr = top_estack - 2;
while (*ptr)
ptr--;
strcpy( (char *) szBuf, (char *) ptr+1 );
goto redo;
}
if (TokenizeSymName( (BYTE *) szBuf,0)) {
TRY
push_setfold( top_estack );
ONERR
goto redo3;
ENDTRY
DlgNotice( "FOLDER CHANGED TO", (char *) szBuf );
top_estack = oldTop;
return(TRUE);
}
redo3:
DlgNotice( "BAD NAME OR FOLDER NOT FOUND", (char *) szBuf );
goto redo2;
}
ONERR
ENDTRY
top_estack = oldTop;
return(FALSE);
}
DIALOG dGetFold, 0, 0, NoCallBack {
EDIT, {0, 8, 15}, XR_FolderC, 0, 8, 9
HEADER, {0, 0, 0}, "SET FOLDER", PDB_OK, PDB_CANCEL
XFLAGS, {0, 0, 0}, XF_ALLOW_VARLINK | XF_VARLINK_SELECT_ONLY, 0, 0, 0
}