The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

INPUT for HP Prime
Message #1 Posted by Eddie W. Shore on 17 Nov 2013, 11:33 a.m.

Since the INPUT can take multiple variables (unlike the 39gii and its predecessors), the command becomes actually useful, like the 50g's INFORM.

INPUT(list of variables, "title string", list of prompts, optional list of help strings, optional list of initial values);

      
Re: INPUT for HP Prime
Message #2 Posted by Han on 17 Nov 2013, 11:58 a.m.,
in response to message #1 by Eddie W. Shore

Quote:
Since the INPUT can take multiple variables (unlike the 39gii and its predecessors), the command becomes actually useful, like the 50g's INFORM.

INPUT(list of variables, "title string", list of prompts, optional list of help strings, optional list of initial values);


To clarify, the list of "initial values" is actually a list of "default values" when the "Edit" menu option is selected. The initial values are whatever is already stored in the list of variables, and is what is shown inside the input box. The default values are what will be seen on the command line when the user proceeds to change the value of the input box.

For example, if A=2, then

INPUT(A, "Title", "A=", "Enter A", -1)

will show A=2, but when the user presses "Edit" they will see -1 in the command line. The -1 will never be seen if the user simply starts typing in a new value for A (it's only visible via "Edit").

            
Re: INPUT for HP Prime
Message #3 Posted by Eddie W. Shore on 17 Nov 2013, 4:25 p.m.,
in response to message #2 by Han

Good point - the values of an INPUT default to zero (I think) if nothing is entered, despite initial values.

                  
Re: INPUT for HP Prime
Message #4 Posted by Michael de Estrada on 17 Nov 2013, 4:46 p.m.,
in response to message #3 by Eddie W. Shore

My experience is that global variables retain their previous value if they are not re-entered with an INPUT statement.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall