(15C) Sums of five lists - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (15C) Sums of five lists (/thread-15086.html) (15C) Sums of five lists - Dave Britten - 05-28-2020 10:57 PM This program lets you quickly accumulate and sum five separate lists/columns of numbers by using the five matrices. In addition to the matrices, the program occupies 11 registers and only uses storage registers 0, 1, and I, so it can be run with DIM (i)=0 to store up to 54 list items across the five lists. Usage Press f MATRIX 0 to clear all data. To append an item to list A, B, C, D, or E, enter the number into x and press f A, f B, f C, f D, or f E respectively. (Alternatively, enable USER mode with f USER, and press A, B, C, D, or E directly.) If flag 1 is clear (f CF 1), the matrix descriptor for the list that the number was appended to will be left in x, showing the name of the matrix and the new count of items. If flag 1 is set (f SF 1), the list's matrix descriptor will be displayed briefly, and then the new total returned in x. (This option increases the processing time for adding an item to the list, as the sum has to be recalculated on each new entry.) To calculate the sum of the list whose matrix descriptor is in x, press GSB 9. To calculate the sums of all lists in sequence, press GSB 1. The program will briefly display the first list's matrix descriptor, followed by the sum of that list. Press R/S to show the next list. Empty lists, or lists with a sum of 0 will be skipped. Example Calculate the sums of two lists: List 1: 250, 150, 525, 275, 300 List 2: 10, 10, 2, 100, 10 (User input shown in bold, displayed results in normal font.) f MATRIX 0 g CF 1 f USER (if USER mode is not already enabled) 250 A A 1 1 150 A A 2 1 525 A A 3 1 275 A A 4 1 300 A A 5 1 10 B b 1 1 10 B b 2 1 2 B b 3 1 100 B b 4 1 10 B b 5 1 GSB 1 A 5 1 (briefly) 1,500.0000 R/S b 5 1 (briefly) 132.0000 R/S 0.0000 (listing is finished) Note that items may be added to the lists in any order, i.e. you aren't required to first fill list A, then B, etc. as is done in the example. Code: ```001  42,21,11   LBL A 002  45,16,11   RCL MATRIX A 003  22 0       GTO 0 004  42,21,12   LBL B 005  45,16,12   RCL MATRIX B 006  22 0       GTO 0 007  42,21,13   LBL C 008  45,16,13   RCL MATRIX C 009  22 0       GTO 0 010  42,21,14   LBL D 011  45,16,14   RCL MATRIX D 012  22 0       GTO 0 013  42,21,15   LBL E 014  45,16,15   RCL MATRIX E 015  42,21,0    LBL 0 016  44 25      STO I 017  33         RDown 018  45,23,25   RCL DIM I 019  43 20      x=0 020  13         10^x 021  34         x>