The Museum of HP Calculators

HP Forum Archive 15

 HP-48 indirect addressing of variablesMessage #1 Posted by Geir Isene on 8 Aug 2005, 4:41 a.m. Situation: I have a set of variables (arrays) in a directory and a program that access the variables. The program asks for user input - the name of one of those variables for which part of the content is to be altered. Problem: How to change the content of a variable whose name is entered by the user? Additional info: This problem is of course easily handled on an older HP calculator that has indirect addressing (STO IND 01). Little info exists on the net regarding indirect addressing on the 48. None of the links I found where applicable to this specific problem. Help or pointers is appreciated.

 Re: HP-48 indirect addressing of variablesMessage #2 Posted by Vieira, Luiz C. (Brazil) on 8 Aug 2005, 6:24 a.m.,in response to message #1 by Geir Isene Hi, Geir; all of my answer is based on User RPL instructions, O.K.? I mean, the one you use regularly. If you are indexing the contents of an array, you could use either PUT or PUTI provided that: the name of the array in stack level 3 surrounded by ' (ex: 'MTX1'); this is the name you (user) enter the location where the data will be placed in the array in stack level 2; if it is a one-row or one-column array, than one number is needed; if it is a bidimensional array, than a list like {row,column} is needed; the data to be entered in stack level 1. As an example: suppose you need to enter the number 10 in row 2, column 3 of MTX1 by using PUT. The followin is the stack contents representation:```4: 3: 'MTX1' 2: {2,3} 1: 10```Than you just need to execute PUT. Remember that all of the three objects above are removed from the stack after PUT is executed. PUTI automatically increments the index in level 2 and keeps both the name of the array (level 2) and the updated index (level 1) in the stack. This has to purpose to be an aid for successive input. Hope this helps. Luiz (Brazil) Edited: 8 Aug 2005, 6:26 a.m.

 Re: HP-48 indirect addressing of variablesMessage #3 Posted by Geir Isene on 8 Aug 2005, 7:11 a.m.,in response to message #2 by Vieira, Luiz C. (Brazil) Yes, this helped. Now I'd like to store the name 'MTX1' in a variable for later retrieval. How do I do that? As I store 'MTX1' in , let's say a variable named 'VAR1', any time I want to retrieve the variable name, it is automatically evaluated - I just want the name of tha variable back to further play with it. Any way to convert "MTX1" to 'MTX1'?