Commands under the cmds menu, Strings, Commands – HP Prime Graphing Calculator User Manual

Page 540: Under the cmds menu, Commands under the cmds menu strings

Advertising
background image

534

Programming in HP PPL

Commands under the Cmds menu

Strings

A string is a sequence of characters enclosed in double
quotes (""). To put a double quote in a string, use two
consecutive double quotes. The \ character starts an
escape sequence, and the character(s) immediately
following are interpreted specially. \n inserts a new line
and two backslashes insert a single backslash. To put a
new line into the string, press

E

to wrap the text at

that point.

ASC

Syntax: ASC (string)
Returns a list containing the ASCII codes of string.
Example: ASC("AB") returns [65,66]

CHAR

Syntax: CHAR(vector) or CHAR(integer)
Returns the string corresponding to the character codes in
vector, or the single code of integer.

Examples: CHAR(65) returns "A"
CHAR([82,77,72]) returns "RMH"

DIM

Syntax: DIM(string)
Returns the number of characters in string.
Example: DIM("12345") returns 5, DIM("""") and
DIM("\n") return 1. (Notice the use of the two double

quotes and the escape sequence.)

Advertising