Extracts n characters from string str starting at index pos. n is optional, if not specied, extracts all the
remainder of the string.
Example: MID("MOMOGUMBO",3,5) returns "MOGUM", MID("PUDGE",4) returns "GE"
ROTATE
Syntax: ROTATE(str,n)
Permutation of characters in string str. If 0 <=n < DIM(str), shifts n places to left. If –DIM(str) < n <= –1, shifts
n spaces to right. If n > DIM(str) or n < –DIM(str), returns str.
Examples:
ROTATE("12345",2) returns "34512"
ROTATE("12345",-1) returns "51234"
ROTATE("12345",6) returns "12345"
STRINGFROMID
Syntax: STRINGFROMID(integer)
Returns, in the current language, the built-in string associated in the internal string table with the specied
integer.
Examples:
STRINGFROMID(56) returns “Complex”
STRINGFROMID(202) returns “Real”
REPLACE
Syntax: REPLACE(object1, start, object2)
Replaces part of object1 with object2 beginning at start. The objects can be matrices, vectors, or stings.
Example:
REPLACE("12345",”3”,”99”) returns "12995"
Drawing
There are 10 built-in graphics variables in the HP Prime, called G0–G9. G0 is always the current screen graphic.
G1 to G9 can be used to store temporary graphic objects (called GROBs for short) when programming
applications that use graphics. They are temporary and thus cleared when the calculator turns o.
Twenty-six functions can be used to modify graphics variables. Thirteen of them work with Cartesian
coordinates using the Cartesian plane dened in the current app by the variables Xmin, Xmax, Ymin, and
Ymax.
The remaining thirteen work with pixel coordinates where the pixel 0,0 is the top left pixel of the GROB, and
320, 240 is the bottom right. Functions in this second set have a _P suix to the function name.
C→PX
Converts from Cartesian coordinates to screen coordinates.
Syntax: C→PX(x,y) or C→PX({x,y})
592 Chapter 28 Programming in HP PPL
Kommentare zu diesen Handbüchern