File: rchar.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 (67 lines) | stat: -rw-r--r-- 2,355 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<HTML>
<HEAD>
<TITLE>RCHAR</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">

<P><A NAME="rchar"></A>
<font size="+3" color="green"><B>RCHAR</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 = RCHAR(scalar)<br />
string = RCHAR(scalar,format)</CODE>
</TD></TR>
</table></p>
<p>
 The <CODE>RCHAR</CODE> function accepts a numeric scalar as first
 argument and returns a string. It converts the numeric value to a string using
 the default format <CODE>%g</CODE>. You can
 specify a C style format string by including it as the optional second string argument.</p>
<p>
 <font size="+1" color="green">Examples</font></P>
<table>
<tr>
 <td align="center" bgcolor="#CCFFFF"><em>function</em></td>
 <td align="center" bgcolor="#FF9966"><em>result</em></td>
</tr><tr>
 <td><CODE>RCHAR(-1.234)</CODE></td>
 <td><font color="orange">'-1.234'</font></td>
</tr><tr>
 <td><CODE>RCHAR(PI,'pi = %6.4f')</CODE></td>
 <td><font color="orange">'pi = 3.1416'</font></td>
</tr><tr>
 <td><CODE>RCHAR(2*PI,'%10.4E')</CODE></td>
 <td><font color="orange">'6.2832E+00'</font></td>
</tr><tr>
 <td><CODE>RCHAR(2*PI,'%10.4e')</CODE></td>
 <td><font color="orange">'6.2832e+00'</font></td>
</tr></table></p>
<p>
 Strings may be appended together using the <a href="../../Operators/append/append.htm">append operator</a>,
 <CODE>//</CODE>. Scalar values can also be
 appended to strings using the <CODE>RCHAR</CODE> function. For example,
 suppose <CODE>A = -1.234</CODE>, and <CODE>T</CODE> is a
 string variable with <CODE>T = ' units'</CODE>.</p>
<p>
<table>
<tr>
 <td align="center" bgcolor="#CCFFFF"><em>function</em></td>
 <td align="center" bgcolor="#FF9966"><em>result</em></td>
</tr><tr>
 <td><CODE>'The value of A is '//RCHAR(A)//T</CODE></td>
 <td><font color="orange">'The value of A is -1.234 units'</font></td>
</tr><tr>
 <td><CODE>'The value of A is '//RCHAR(A,'%4.1f')//T</CODE></td>
 <td><font color="orange">'The value of A is -1.2 units'</font></td>
</tr></table></p>
<p>
 <a href="string.htm"><img border="0" src="../../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">STRING</font></a><br />
 <a href="eqs.htm"><img border="0" src="../../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">EQS</font></a>
</P>
</BODY>
</HTML>