// throw the appropriate error if the user enters too many or
// too few arguments, or doesn't enter a LIST or MATRIX
if (argumentNumber > 2)
ER_throwVar (940);
if (argumentNumber < 2)
ER_throwVar (930);
if (*listPointer != LIST_TAG)
ER_throwVar (90);
// get a pointer to the second argument
itemPointer = next_expression_index (listPointer);
// decrement listPointer so it points to first element in list
listPointer--;
// designate the end of the list of indices that will be
// pushed to the expression stack
push_quantum (END_TAG);
// step through the list, examining each element to see
// if it matches target item; if it does, add its
// position to the list
while (*listPointer != END_TAG)
{
// compare_expressions returns 0 if the items match
if (compare_expressions(listPointer, itemPointer) == 0)
push_longint (index);
// advance pointer to the next element
listPointer = next_expression_index (listPointer);
index++;
}
// list on the top of the stack is in descending order, so
// reverse the list so items are in ascending order
push_reversed_tail (top_estack);
push_quantum (LIST_TAG);
// estack clean up
itemPointer = next_expression_index (top_estack);
while (*itemPointer != END_TAG)
{
listPointer = itemPointer;
itemPointer = next_expression_index (itemPointer);
delete_expression (listPointer);
}
} // main
(Credit to Brett Sauerwein for the C version)
3 - 33
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...