1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
<HTML>
<HEAD>
<TITLE>EVALUATE</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">
<P><A NAME="evaluate"></A>
<font size="+3" color="green"><B>EVALUATE</B></font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>
numeric = EVALUATE(string)</CODE>
</TD></TR>
</table></p>
<p>
String variables can be used in numeric expressions, as so called
<em>expression variables</em>, to shorten or to simplify an expression. Parentheses around
the expression variable are assumed during numeric evaluation. For example:</p>
<p>
<font color="blue"><pre>
T='A+B'
Y=X*T ! this is equivalent to Y=X*(A+B)
</pre></font></p>
<p>
A string variable will be numerically evaluated if it is a numeric operand or the argument of
a numeric function. Otherwise, a string variable is treated as a string. Use the
<CODE>EVALUATE</CODE> function to force numeric evaluation. The type of
result, that is, scalar, vector, or matrix, depends on the evaluated expression. The string
argument will not be modified.</p>
<p>
<font size="+1" color="green">Examples</font></p>
<p>
Suppose that string variable <CODE>T='3+2'</CODE>.</p>
<p>
<table>
<tr>
<td align="center" bgcolor="#CCFFFF"><em>input</em></td>
<td align="center" bgcolor="#FF9966"><em>result</em></td>
</tr><tr>
<td><CODE>=T</CODE></td>
<td>the string <font color="orange">'3+2'</font></td>
</tr><tr>
<td><CODE>=EVALUATE(T)</CODE></td>
<td>the numeric value <font color="orange">5</font></td>
</tr></table></p>
<p>
<a href="index.htm"><img border="0" src="../../shadow_left.gif">
<font size="+1" color="olive">INDEX</font></a><br />
<a href="expand.htm"><img border="0" src="../../shadow_right.gif">
<font size="+1" color="olive">EXPAND</font></a>
</P>
</BODY>
</HTML>
|