The Request Command

request.png

Command Summary

Asks for a string in a dialog box.

Command Syntax

Request promptString, var

Menu Location

Starting in the program editor:

  • Press F3 to enter the I/O menu.
  • Press 1 to enter the Dialog submenu.
  • Press 2 to select Request.

Calculator Compatibility

This command works on all calculators.

Token Size

? bytes

On its own, the Request command asks for a string in a dialog box, while showing the prompt string to its left. It can also be used inside a Dialog..EndDlog block, to add a line of text to a more advanced dialog.

The text must be a single string, but you can build one out of smaller strings and other data types using the & and string() commands.

Request will give an error if the string is too long — how long varies from model to model, and depending on if text is being used inside or outside Dialog..EndDlog, but in general anything below 30 characters is safe (otherwise, you should test the dialog first to make sure everything fits). It uses the small, variable-width font on the TI-89 and TI-89 Titanium, and the normal fixed-width font on widescreen calculators.

Advanced Uses

You can add 0 as a third argument for the calculator to turn off alpha lock when typing text, but all Request commands in a dialog box must have the same alpha-lock setting. The setting can be used to ask for a number, using expr() as well.

Error Conditions

130 - Argument must be a string happens when Text is used to display other data types without using string() first.

230 - Dimension happens when the line of text is too long to fit in a dialog box.

Related Commands

See Also

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.