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
|
<HTML>
<HEAD>
<TITLE>Character arrays</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">
<P><font size="+3" color="green"><B>Character arrays</B></font></P>
<P>
An element of a array character variable is a character string, for example,
<CODE>T</CODE> is an array character variable with <code>3</code> elements:</P>
<font color="blue"><PRE>
T[1] = 'This is line one'
T[2] = 'This is line two'
T[3] = 'This is line three'
</PRE></font>
<P>
Array character variables can be defined with the
<CODE><a href="../Commands/Read.htm">READ</a></CODE>
command by entering more than one line number to read. For example:
<font color="blue"><PRE>
READ\TEXT FILE.DAT/[1:5] T
</PRE></font></p>
<P>
creates array character variable <CODE>T</CODE> with
<code>5</code> elements. Array character variables can also be defined with a
character assignment, as above.</p>
<p>
To specify the character elements of an array element of a array character
variable, use another set of brackets. For example, if
<CODE>T[3]='abcdefghijkl'</CODE> then
<CODE>T[3][1:10:2]</CODE> specifies characters
<code>1, 3, 5, 7, 9</code> of array element <code>3</code> of the array
character variable <CODE>T</CODE>, which is
'<CODE>acegi</CODE>'. There is no maximum number of array elements for a
character variable. There is no maximum character length for an
array element.</P>
<P>
<a href="ExpressionS02.htm"><img src="../shadow_left.gif">
<font size="+1" color="olive">String assignments</font></a><br />
<a href="ExpressionS04.htm"><img src="../shadow_right.gif">
<font size="+1" color="olive">Evaluations</font></a></P>
</BODY>
</HTML>
|