EasyManuals Logo
Home>Texas Instruments>Calculator>TI-92+

Texas Instruments TI-92+ User Manual

Texas Instruments TI-92+
507 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
C version
The TI Basic functions above are functional but slow. The same functionality can be programmed in C,
but the trade-off is increased hassle in that ASM functions, including those written in C, cannot be used
in expressions. Tip [12.2] shows how to get around this by installing a couple of hacks. Note that you
must use the correct version of inlist() for your calculator model: .89z for the TI-89, and .9xz for the
TI-92 Plus.
The C version, inlist(), works the same as indexlst() above for lists. However, for matrices, inlist() is
used to search for a row of elements, and not the individual elements.
An early version of inlist(), which only found a single element occurence, was about 22 times faster
than the equivalent TI Basic version.
The source code for inlist() follows:
/*********************************************************************
This function searches a specified list for a specified item. If the
target item is found, the function returns a list containing the position
of item. If the item is found more than once, the function returns
a list containing all the indices of the target item. If the item is not
found, the function returns an empty list. No restrictions exist on the
types of items in the list.
Error Code Descriptions
90 -- Argument must be a list
930 -- Too few arguments
940 -- Too many arguments
Syntax: inlist(list, item)
inlist(matrix, row)
Since a matrix is defined as a list of lists, this function will also
work with input such as inlist([1,2;2,3], {1,2})
Thanks to Samuel Stearley for his help in optimizing this program.
Brett Sauerwein
15 March 02
********************************************************************/
#define USE_TI89
#define USE_TI92PLUS
#define OPTIMIZE_ROM_CALLS
#define RETURN_VALUE
#include <tigcclib.h>
void _main(void)
{
unsigned char *listPointer, *itemPointer;
int argumentNumber = 0;
int index = 1;
// get a pointer to the first argument entered by the user
InitArgPtr (listPointer);
argumentNumber = remaining_element_count (listPointer);
3 - 32

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TI-92+ Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-92+
CategoryCalculator
LanguageEnglish

Related product manuals