HP Prime Graphing Wireless Calculator User Manual
Page 300
296
Programming in HP PPL
INPUT
Syntax: INPUT(var,[“title”], [“label”], [“help”],
[reset_value][initial_value])
INPUT({vars},[“title”], [{“labels”}], [{“help”}],
[{reset_values}], [{initial_values}])
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 the 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, the
variable 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 syntax.
•
{var_name, real, [{pos}]} to create a check box
control. If real is >1, this check box gets pooled with
the next n -1 check boxes in a radio group (that is,
only one of the n check boxes 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, the edition hides 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
%, field width in screen%, line(starts at 0)}. This allows you
to control the precise 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 seven lines of controls per page.
Controls with more than seven lines are placed in
subsequent pages. If more than one page is created,
["title"] can be a list of titles.