HP Forums
Problem with negative numbers for INPUT function - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Problem with negative numbers for INPUT function (/thread-5693.html)

Problem with negative numbers for INPUT function - UncleJohn - 02-16-2016 07:19 PM

I have just registered so I apologize for not being familiar with your procedures. I purchased a wireless Prime directly from HP late December. Currently I am having a problem with a simple Mandelbrot program . I use INPUT to enter data including the x and y centres for the region of interest. I supply default values one of which is negative . If I run the program without editing the negative value , it runs as expected . if I enter any negative value ,including an exact copy of the negative default, then an Invalid Input error message is displayed. I will attach a copy of the program. I would be pleased to hear from anyone who can point out what is causing this behaviour. I should note that I have experienced difficulty obtaining documentation on the Prime,for example I have not found an example of using INPUT for multiple lines of data .

Thanks in advance



RE: Problem with negative numbers for INPUT function - John Colvin - 02-16-2016 07:36 PM

This is a bug with the Input command. When editing the input value, single quotes are placed around the new entry causing the error message. Entering the new negative value without quotes works correctly without any errors.

RE: Problem with negative numbers for INPUT function - Terje Vallestad - 02-16-2016 09:05 PM

(02-16-2016 07:19 PM)UncleJohn Wrote:  I have not found an example of using INPUT for multiple lines of data .
Have you checked the on calculator help text?


Syntax: INPUT(var,[“title”], [“label”], [“help”], [reset_value][initial_value]) INPUT({vars},[“titles”], [{“labels”}], [{“helps”}], [{reset_values}], [{initial_values}]) var -> {var_name, real, [{pos}]} var -> {var_name, [allowed_types_matrix], [{pos}]} var -> {var_name, {choose_items}, [{pos}]}

The simpler form of this command opens a dialog box with the given title and one field named label, displaying help at the bottom. The dialog box includes Cancel and OK menu keys. The user can enter a value in the labeled field. If the user presses the OK menu key, the variable var is updated with the entered value and 1 is returned. If the user presses the Cancel menu key, var is not updated and 0 is returned.

In the more complex form of the command, lists are used to create a multi- field dialog box. If var is a list, each element can be either a variable name or a list using the following format:

{var_name, real, [{pos}]} to create a checkbox control. If real is >1, then this checkbox gets pooled with the next n -1 checkboxes in a radio group (ie, only one of the n checkboxes can be checked at any time)

{var_name, [allowed_types_matrix], [{pos}]} to create an edit field. allowed_types_matrix lists all the allowed types ([-1] stands for all types allowed). If the only allowed type is a string, then the edition will hide the double quotes.

{var_name, {choose_items}, [{pos}]} to create a choose field.

If pos is specified, it is a list of the form { field start in screen percentage, field width in screen percentage, line (starts at 0) }. This allows you to control precisely the position and size of your fields. Note that you have to specify pos for either none or all fields in the dialog box.

There is a maximum of 7 lines of controls per page. Controls with more than 7 lines will be placed in subsequent pages. If more than one page is created, titles can be a list of titles.

Maybe this helps?

Cheers, Terje

RE: Problem with negative numbers for INPUT function - churichuro - 02-17-2016 02:55 PM

please more examples, option 1 and 2 is easy but how use checkbox and radio group