Debian Codegraph @

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

raw
1 <html><head><title>XLISP string-not-greaterp</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-not-greaterp</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>predicate 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-not-greaterp <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 not significant with this function</dd>
46 </dl>
47
48 <h2>Description</h2>
49
50 <p>The 'string-not-greaterp' [string-not-greater-than] predicate function
51 takes two string arguments. A non-<a href="nil.htm">NIL</a> value
52 is returned if '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</a> [char-not-greater-than] the corresponding
58 character of 'string2'. This test is not case sensitive, the character
59 '#\a' is considered to be the same as '#\A'.</p>
60
61 <p>The keyword arguments allow for accessing substrings within 'string1' and
62 'string2'. The keyword arguments each require a keyword ':start1', ':end1',
63 ':start2' or ':end2' and a single integer expression as a pair with the
64 keyword first and the integer second. The pairs may be in any order. The
65 ':startN' keywords specify the starting offset of the substring. A value of
66 0 starts the string at the beginning [no offset]. The ':endN' keywords
67 specify the ending offset of the substring. A value of 3 ends the string
68 after the 3rd character [an offset of 3 characters].</p>
69
70 <h2>Examples</h2>
71
72 <pre class="example">
73 (string-not-greaterp "a" "b") <font color="#008844">; returns 0</font>
74 (string-not-greaterp "b" "a") <font color="#008844">; returns NIL</font>
75 (string-not-greaterp "a" "a") <font color="#008844">; returns 1</font>
76 (string-not-greaterp "a" "A") <font color="#008844">; returns 1</font>
77 (string-not-greaterp "A" "a") <font color="#008844">; returns 1</font>
78 (string-not-greaterp "abc" "abc ") <font color="#008844">; returns 3</font>
79 (string-not-greaterp "12345" "1234qr") <font color="#008844">; returns 4</font>
80
81 (string-not-greaterp "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-not-greaterp">string-not-greaterp</a>
87 predicate 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>