Debian Codegraph @

docsrc/xlisp/xlisp-doc/reference/string-not-greaterp-s.htm

raw
1 <html><head><title>XLISP string&lt;=</title>
2
3 <link rel="stylesheet" type="text/css" href="reference.css">
4
5 </head>
6
7 <body>
8
9 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
10 <a href="../manual/contents.htm">Contents</a> |
11 <a href="../tutorials/tutorials.htm">Tutorials</a> |
12 <a href="../examples/examples.htm">Examples</a> |
13 <a href="reference-index.htm">Reference</a>
14
15 <hr>
16
17 <h1>string&lt;=</h1>
18
19 <hr>
20
21 <p><table cellpadding="0" cellspacing="0" style="margin-left:10px"><tbody>
22 <tr valign="top">
23 <td><nobr>Type:</nobr></td>
24 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
25 <td width="100%"><nobr>function (subr)</nobr></td>
26 </tr>
27 <tr valign="top">
28 <td><nobr>Source:</nobr></td>
29 <td><nobr>&nbsp;&nbsp;-&nbsp;&nbsp;</nobr></td>
30 <td width="100%"><nobr>xlstr.c</nobr></td>
31 </tr>
32 </tbody></table></p>
33
34 <h2>Syntax</h2>
35
36 <dl>
37 <dt>(string&lt;= <i>string1 string2</i> [<i>key offset</i>] ... )</dt>
38 <dd><i>stringN</i> - a string expression<br>
39 <i>key</i> - a keyword [one of :start1 :start2 :end1 :end2]<br>
40 <i>offset</i> - an optional integer expression for a keyword<br>
41 returns - a non-<a href="nil.htm">NIL</a> value if <i>string1</i>
42 is less than or equal to <i>string2</i> in
43 <a href="../misc/ascii-table.htm">ASCII</a> ordering,
44 <a href="nil.htm">NIL</a> otherwise<br>
45 <b>Note:</b> case is significant with this function</dd>
46 </dl>
47
48 <h2>Description</h2>
49
50 <p>The 'string&lt;=' [string-less-than-or-equal] function takes two string
51 arguments. A non-<a href="nil.htm">NIL</a> value is returned if
52 'string1' is less than or equal to 'string2' in
53 <a href="../misc/ascii-table.htm">ASCII</a> ordering, otherwise
54 <a href="nil.htm">NIL</a> is returned. The
55 non-<a href="nil.htm">NIL</a> value returned is the integer index
56 of the first character of 'string1' which is
57 <a href="char-not-greaterp-s.htm">char&lt;=</a> [char-less-than-or-equal] to the
58 corresponding character of 'string2'. This test is case sensitive, the
59 character '#\a' is different and of greater
60 <a href="../misc/ascii-table.htm">ASCII</a> value than '#\A'.</p>
61
62 <p>The keyword arguments allow for accessing substrings within 'string1' and
63 'string2'. The keyword arguments each require a keyword ':start1', ':end1',
64 ':start2' or ':end2' and a single integer expression as a pair with the
65 keyword first and the integer second. The pairs may be in any order. The
66 ':startN' keywords specify the starting offset of the substring. A value of
67 0 starts the string at the beginning [no offset]. The ':endN' keywords
68 specify the ending offset of the substring. A value of 3 ends the string
69 after the 3rd character [an offset of 3 characters].</p>
70
71 <h2>Examples</h2>
72
73 <pre class="example">
74 (string&lt;= "a" "b") <font color="#008844">; returns 0</font>
75 (string&lt;= "a" "a") <font color="#008844">; returns 1</font>
76 (string&lt;= "a" "A") <font color="#008844">; returns NIL</font>
77 (string&lt;= "A" "a") <font color="#008844">; returns 0</font>
78 (string&lt;= "abc" "abc ") <font color="#008844">; returns 3</font>
79 (string&lt;= "1234567" "1234qrst") <font color="#008844">; returns 4</font>
80
81 (string&lt;= "J Smith" "K Smith" :start1 1 :start2 1) <font color="#008844">; strip off the first chars</font>
82 <font color="#008844">; returns 7</font>
83 </pre>
84
85 <p>See the
86 <a href="../manual/xlisp-man-025.htm#string-less-than-or-equal">string&lt;=</a>
87 function in the <nobr>XLISP 2.0</nobr> manual.</p>
88
89 <p><nobr>&nbsp;&nbsp;<a href="#top">Back to Top</nobr></a></p>
90
91 <hr>
92
93 <a href="../start.htm">Nyquist / XLISP 2.0</a>&nbsp; -&nbsp;
94 <a href="../manual/contents.htm">Contents</a> |
95 <a href="../tutorials/tutorials.htm">Tutorials</a> |
96 <a href="../examples/examples.htm">Examples</a> |
97 <a href="reference-index.htm">Reference</a>
98
99 </body></html>