File: expand.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (44 lines) | stat: -rw-r--r-- 1,580 bytes parent folder | download
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
<HTML>
<HEAD>
<TITLE>EXPAND</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">

<P><A NAME="expandfunction"></A>
<font size="+3" color="green"><B>EXPAND</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>
string = EXPAND(string)</CODE>
</TD></TR>
</table></p>
<p>
 The <CODE>EXPAND</CODE> function accepts a string as argument.
 The result is also a character string. It parses the argument, expanding any expression
 variables it finds. If an expression variable, contained in the argument, also contains
 expression variables then they are also expanded, and so on until all such expression
 variables have been expanded. Syntax checking is done during the expansion.</p>
<p>
 <font size="+1" color="green">Example</font></p>
<p>
 <font color="blue"><pre>
 A=2             ! define a scalar A
 B=3             ! define a scalar B
 FC1='(A+B)/A'   ! define a string variable FC1
 FC2='SQRT(A/B)' ! define a string variable FC2
 FC3='FC1*FC2'   ! define a string variable FC3
 FC4='FC3+4*FC2' ! define a string variable FC4
 =FC4            ! displays 'FC3+4*FC2'
 =EXPAND(FC4)    ! displays '(((A+B)/A)*(SQRT(A/B)))+4*(SQRT(A/B))'
 =EVALUATE(FC4)  ! displays 5.3073
 </pre></font></p>
<p>
 <a href="eval.htm"><img border="0" src="../../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">EVALUATE</font></a><br />
 <a href="canopen.htm"><img border="0" src="../../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">CANOPEN</font></a>
</P>
</BODY>
</HTML>