Texas Instruments TI-89 Developer's Manual page 1072

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

Advertisement

1030
SetOK
(continued)
Example:
This example sets the global OK variable to 1 if the graph is blank or 0 if it
is not blank (axes not included).
#include "tiams.h"
void main(void)
{
Access_AMS_Global_Variables;
WORD SaveSize;
HANDLE hBitmap;
BYTE *Ptr;
WIN_RECT wr;
BOOL flag;
WINDOW *winPtr;
wr = *MakeWinRect(0,0,gr_active->xmaxpix,gr_active->ymaxpix);
winPtr = gr_active->grwinp;
if ((SaveSize = WinBitmapSize( winPtr, &wr )) > 0) {
if (hBitmap = HeapAlloc(SaveSize)) {
Ptr = HeapDeref(hBitmap);
flag = WinDupStat( winPtr, TRUE );
WinBitmapGet( winPtr, &wr, (BITMAP *) Ptr );
WinDupStat( winPtr, flag );
SaveSize -= BITMAP_HDR_SIZE;
Ptr += BITMAP_HDR_SIZE;
flag = TRUE;
while (SaveSize--) {
if (*Ptr++) {
flag = FALSE;
break;
}
}
HeapFree( hBitmap );
SetOK( flag );
}
else
ER_THROW( ER_MEMORY );
}
else
ER_THROW( ER_RESERVED );
}
TI-89 / TI-92 Plus Developer Guide
Appendix A: System Routines — Symbol Table Utilities
Not for Distribution
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