HP NW280-200X User Manual page 458

Prime graphing calculator
Table of Contents

Advertisement

Qualifying
the name of a
variable
Functions,
their
arguments,
and
parameters
452
INPUT(RADIUS);
END;
Note that EXPORT
command for the
variable RADIUS
appears before the
heading of the function
where RADIUS is
assigned. After you
execute this program, a
new variable named RADIUS appears on the USER
GETRADIUS section of the Variables menu.
The HP Prime has many system variables with names that
are apparently the same. For example, the Function app
has a variable named Xmin, but so too does the Polar
app, the Parametric app, the Sequence app, and the
Solve app. In a program, and in the Home view, you can
refer to a particular version of these variables by
qualifying its name. This is done by entering the name of
the app (or program) that the variable belongs to,
followed by a dot (.), and then the actual variable name.
For example, the qualified variable Function.Xmin
refers to the value of Xmin within the Function app.
Similarly, the qualified variable Parametric.Xmin
refers to the value of Xmin in the Parametric app. Despite
having the same name—Xmin—the variables could have
different values. You do likewise to declare a local
variable in a program: specify the name of the program,
followed by the dot, and then variable name.
You can define your own functions in a program, and data
can be passed to a function using parameters. Functions
can return a value (using the RETURN statement) or not.
When a program is executed from Home view, the
program will return the value returned by the last statement
that was executed.
Furthermore, functions can be defined in a program and
exported for use by other programs, in much the same
way that variables can be defined and used elsewhere.
Programming

Advertisement

Table of Contents
loading

Table of Contents