Texas Instruments TI-89 Developer's Manual page 114

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

72
if (hCommand = HeapAlloc(80)) {
strcpy(pCommand = HeapDeref(hCommand), ProgName );
strcat(pCommand, "()" );
if (hResult = TIBASIC_run(hCommand, &errCode))
HeapFree(hCommand);
if (errCode)
}
}
return TRUE;
}
void DelVar( char *varName )
{
BYTE nameBuf[MAX_SYM_LEN];
TRY
if (FS_OK == TokenizeName( varName, nameBuf ))
ONERR
ENDTRY
}
static void AP_app(pFrame self, PEvent e)
{
HANDLE hVal;
switch (e->command) {
case CM_ACTIVATE:
case CM_QUIT:
default:
}
}
The previous example showed how to run a TI-BASIC program from an
application. If an application just needs to execute a function or expression to
return some value then the following example will do that. The function
tCmdLineDriver below inputs a string from the user using a dialog box. It then
calls the function CmdLine to execute that string and return a value. The return
value is stored to a global variable, E1. If there is an error then an error dialog is
displayed. The CmdLine function will evaluate the string and return a value on
the estack. It will not evaluate anything that has side effects — that is the
TI-89 / TI-92 Plus Developer Guide
HeapFree(hResult);
{
ERD_dialog( errCode, FALSE );
return(FALSE);
cmd_delvar( TokNameRight(nameBuf) );
if (!runningBASIC) {
push_quantum( END_TAG );
EV_defaultHandler(e);
if (StoProg( "prog1", prog1Data ))
RunProg( "prog1" );
DelVar( "prog1" );
EV_quit();
}
break;
break;
EV_defaultHandler(e);
break;
Not for Distribution
Chapter 8: Integrating a Flash Application
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents