|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Converts any expression to a string.
string(expression)
Menu Location
- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the String submenu.
- Press 1 to select string(.
This command works on all calculators.
2 bytes
The string() command converts any expression to its string form. This applies to numbers, but also to lists, matrices, symbolic expressions, and equations. The result depends on all the mode settings that are typically involved with displaying a number: base, exact/approx setting, etc.
:string(50)
"50"
:string({1,2,3,4,5})
"{1,2,3,4,5}"
:string(1/(1-x))
"-1/(x-1)"The main use of string() is with output commands like PtText, PxlText, Text, Title, etc. These commands only work with strings, so for any other data type, you'll have to use string() first — & will also come in handy. For example:
:Text "The value of x is: "&string(x)If you're just converting numbers, you might also want to look into format(), which only applies to numbers and also puts them in a specific form.
Advanced Uses
Together with the # (indirection) operator, string() can be used to access variables like a1, a2, a3, …, in order:
:#("a"&string(n))