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 #645 background imageLoading...
Page #645 background image
Appendix A: System Routines — Graphing
603
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
GraphActivate
(continued)
Example:
The cmd_circle function, if it were part of an app, would be as shown below
along with two of its helper routines (GetAttr and isShortFloat). It (like most
of the TI
-
BASIC graphing commands and functions) uses
GraphActivate
to activate the Graph app and then it draws an ellipse to the graph window
using the parameters passed to it.
The second example, appfocus.c, is a complete app that:
Sets a global flag before activating the Graph app so that this app will
ignore the quit message when the grapher is active. The app will still
lose the focus and cannot write to any of its windows but it will not
completely shut down.
Activates the Graph app, drawing a circle just to do something.
Reactivates itself so now it is back to being the currently active app.
/* Get a valid attribute value (0, 1, -1) and return its corresponding
screen attribute (A_REVERSE, A_NORMAL, A_XOR).
*/
short GetAttr( EStackIndex i ) {
SWORD RetInt;
RetInt = GetValue( i, -1, 1 );
if (RetInt == -1)
return A_XOR;
else if (RetInt == 0)
return ((RetInt == 0) ? A_REVERSE : A_NORMAL);
}
/* If the given Float value is in the range of a short integer return that value;
otherwise, throw a domain error.
*/
short isShortFloat( BCD16 Float ) {
short RetInt;
if (Float < FPN32768 || Float > FP32767)
ER_THROW( ER_DOMAIN )
RetInt = Float;
return( RetInt );
}
void cmd_circle (EStackIndex i, EStackIndex j, EStackIndex k, EStackIndex m) {
Access_AMS_Global_Variables;
BCD16 rFlt;
short a0, b0;
BYTE OrigAttr;
(continued)

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