# Programming HP Calculators/Commands/Prompt Commands
## BEEP

Syntax
Detail
* Uses the calculator's piezoelectric beeper to beep at a frequency of <freq> Hz for <time> seconds.
Example
This program generates a random number from 1 to 10, and prompts the user for a guess. If the user guesses correctly, the calculator beeps twice with rising pitch (typical "correct" sound). Otherwise, it beeps twice with lowering pitch (typical "wrong" sound), and tells the user if the answer is higher or lower than what they specified.

## CHOOSE

Syntax
Detail
* Allows the user to select from a set of options given on the screen.
* After two ;s, CHOOSE starts allocating spaces on the on-screen menu and assigning values to those spaces. Therefore, in the syntax example, <option-1> would have a value of 1 - if it were selected, <variable> would be set to 1.
* This option is best used in conjunction with CASE to define the effect of each option.
Dangers
* CHOOSE starts with the current value of <variable> as the item selected. Therefore, it will be impossible to use the menu should the variable have a value that is not a positive integer, or is greater than the number of options.
* A simple workaround for the following is always inserting 1?<variable> at the start of the CHOOSE command, to ensure that the first option is selected by default.

## DISP

Syntax
Detail
* Displays <text> on line number <line> (1 to 7).
* Although there is room for 8 lines after an ERASE, setting <line> as less than 1, non-integer, or more than 7 will result in the text simply not printing (no error message).
* DISPXY is able to handle printing on the "8th line", should you require more room.
Dangers
* DISP erases the contents of the entire line that it is about to print on, regardless of whether or not pixels have already been drawn in that area. Therefore, you should always use DISP first, should you intend to draw over it. DISPXY corrects this problem to a degree, although use of it still results in some whitespace being forced over your drawing.
* This can be used to your advantage should you wish to blank out a certain line of text, simply use DISP <line>;" ":. This can be advantageous as it will obfuscate your code (if you want to limit the alterations people make to your code), and because it is much faster than any other method (although it allows the least control).
Example
Displays the ubiquitous "Hello World" on the first line on the screen, after erasing the screen, and freezes the program at the end so that the user has time to read the message.
Advanced: Approximates phi using the ratio between increasing Fibonacci numbers. The ability of DISP to erase the line before displaying its payload creates an interesting-looking "reiterative" effect.

## DISPTIME

Syntax
Detail
* Displays the date and time in a message box.
* The time is stored in the TIME and DATE real variables.
** TIME syntax: hh.mmss (with hh in 24-hour time). For example, 2:30PM is 14.3000. Since the variable is an integer, the 0s at the end actually go on for 13 characters; this is because the TIME variable actually stores fractions of seconds, too. (Thus you could set 1PM as just 13, or 12:05:30.136 as 12.0530136.)
** DATE syntax: mm.ddyyyy. For example, 21st September, 2005 is 9.212005.
Example This program is called "TimeUtils".
This program is a multi-function application that allows you to both display and edit (correct) the current time. Most of it should be self-explanatory, given the information about the DATE and TIME variables in Details.

## EDITMAT

See EDITMAT under the matrix commands section for information on this command.

## FREEZE

Syntax
Detail
* Pauses the running of the program, waiting for input from a key.
* Best used after using drawing commands, or else the drawings will disappear from the screen straight away.
* For the readers who know more advanced programming languages, it is the same as GETKEY, but it does not return a value to the calculator (ie. cannot detect which key was pressed).

## MSGBOX

Syntax
Detail
* The simplest way of displaying a message on screen, requiring only the text to be displayed; however, this is its weakness - it offers almost no control.
* Automatically incorporates a FREEZE, that is, you need to press a key to get out of the MSGBOX.
Example