EasyManuals Logo

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #114 background imageLoading...
Page #114 background image
72
Chapter 8: Integrating a Flash Application
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
if (hCommand = HeapAlloc(80)) {
strcpy(pCommand = HeapDeref(hCommand), ProgName );
strcat(pCommand, "()" );
if (hResult = TIBASIC_run(hCommand, &errCode))
HeapFree(hResult);
HeapFree(hCommand);
if (errCode) {
ERD_dialog( errCode, FALSE );
return(FALSE);
}
}
return TRUE;
}
void DelVar( char *varName )
{
BYTE nameBuf[MAX_SYM_LEN];
TRY
if (FS_OK == TokenizeName( varName, nameBuf ))
cmd_delvar( TokNameRight(nameBuf) );
ONERR
ENDTRY
}
static void AP_app(pFrame self, PEvent e)
{
HANDLE hVal;
switch (e->command) {
case CM_ACTIVATE:
if (!runningBASIC) {
push_quantum( END_TAG );
EV_defaultHandler(e);
if (StoProg( "prog1", prog1Data ))
RunProg( "prog1" );
DelVar( "prog1" );
EV_quit();
}
break;
case CM_QUIT:
break;
default:
EV_defaultHandler(e);
break;
}
}
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

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals