<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AExpr</id>
	<title>TI-BASIC:Expr - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AExpr"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Expr&amp;action=history"/>
	<updated>2026-04-19T21:14:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Expr&amp;diff=1126&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Expr&amp;diff=1126&amp;oldid=prev"/>
		<updated>2016-02-24T18:35:56Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:TI-BASIC:Command&lt;br /&gt;
|picture=EXPR.GIF&lt;br /&gt;
|summary=Returns the value of a string that contains an expression.&lt;br /&gt;
|syntax=expr(&amp;#039;&amp;#039;string&amp;#039;&amp;#039;)&lt;br /&gt;
|location=This command is found only in the Catalog. Press:&lt;br /&gt;
# 2ND CATALOG to enter the catalog&lt;br /&gt;
# F to go to commands starting with F&lt;br /&gt;
# Scroll up a bit to expr(.&lt;br /&gt;
|compatibility=TI-83/84/+/SE&lt;br /&gt;
|size=2 bytes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The expr( command is used to evaluate an expression that&amp;#039;s stored in a string (an expression is merely anything that returns a value - of any type). Expressions are occasionally stored to strings, rather than evaluated outright, so that their value has the capacity to change when the variables stored inside them change.  The expr( command&amp;#039;s result depends on the kind of expression that&amp;#039;s in the string you pass it -- it may return a number, a list, a matrix, or even another string. &lt;br /&gt;
&lt;br /&gt;
As a special case of an expression, the expr( command can also be used to convert a string like &amp;quot;123&amp;quot; to the number 123. Going in the reverse direction (123 to &amp;quot;123&amp;quot;) is [[TI-BASIC:Number_To_String|more complicated]].&lt;br /&gt;
&lt;br /&gt;
The expr( command has limitations. Here are the situations in which expr( will not work:&lt;br /&gt;
&lt;br /&gt;
* When the code in the string does not return an answer, and thus is not an expression: e.g. expr(&amp;quot;Line(0,0,1,1&amp;quot; or expr(&amp;quot;prgmHELLO&amp;quot; is invalid&lt;br /&gt;
* When the expression in the string contains an expr( command itself, e.g. expr(&amp;quot;expr(Str1&amp;quot; -- this will throw an [[TI-BASIC:Errors#illegalnest|ERR:ILLEGAL NEST]] error.&lt;br /&gt;
* In place of a variable (rather than an expression), e.g. 5→expr(&amp;quot;X&amp;quot; isn&amp;#039;t a substitute for 5→X because expr(&amp;quot;X&amp;quot; evaluates to the value of X and not to X itself.&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
expr( is often used in conjunction with the [[TI-BASIC:Input|Input]] command to prompt the user to enter a list. Although the Input command can already handle lists, it requires the user to enter the opening bracket that signifies a list. With expr(, this can be avoided.&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
&lt;br /&gt;
 :Input L1&lt;br /&gt;
&lt;br /&gt;
Use this:&lt;br /&gt;
&lt;br /&gt;
 :Input Str1&lt;br /&gt;
 :expr(&amp;quot;{&amp;quot;+Str1→L1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Optimization =&lt;br /&gt;
&lt;br /&gt;
Evaluating an expression inside a string is more complicated than evaluating a normal expression; you should therefore try to take as much out of an expr( statement as possible to speed up your code. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 :expr(&amp;quot;sum({&amp;quot;+Str1&lt;br /&gt;
 can be&lt;br /&gt;
 :sum(expr(&amp;quot;{&amp;quot;+Str1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Error Conditions =&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#illegalnest|ERR:ILLEGAL NEST]]&amp;#039;&amp;#039;&amp;#039; is thrown when the string to be evaluated contains an expr( itself.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#invalid|ERR:INVALID]]&amp;#039;&amp;#039;&amp;#039; is thrown when trying to evaluate the empty string.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#syntax|ERR:SYNTAX]]&amp;#039;&amp;#039;&amp;#039; is thrown when trying to evaluate a command that doesn&amp;#039;t return a value.&lt;br /&gt;
&lt;br /&gt;
= Related Commands =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Sub|Sub(]]&lt;br /&gt;
* [[TI-BASIC:Instring|InString(]]&lt;br /&gt;
* [[TI-BASIC:Length|Length(]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>