XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

string-not-greaterp


Type:   -   predicate function (subr)
Source:   -   xlstr.c

Syntax

(string-not-greaterp string1 string2 [key offset] ... )
stringN - a string expression
key - a keyword [one of :start1 :start2 :end1 :end2]
offset - an optional integer expression for a keyword
returns - a non-NIL value if string1 is less than or equal to string2 in ASCII ordering, NIL otherwise
Note: case is not significant with this function

Description

The 'string-not-greaterp' [string-not-greater-than] predicate function takes two string arguments. A non-NIL value is returned if 'string1' is less than or equal to 'string2' in ASCII ordering, otherwise NIL is returned. The non-NIL value returned is the integer index of the first character of 'string1' which is char-not-greaterp [char-not-greater-than] the corresponding character of 'string2'. This test is not case sensitive, the character '#\a' is considered to be the same as '#\A'.

The keyword arguments allow for accessing substrings within 'string1' and 'string2'. The keyword arguments each require a keyword ':start1', ':end1', ':start2' or ':end2' and a single integer expression as a pair with the keyword first and the integer second. The pairs may be in any order. The ':startN' keywords specify the starting offset of the substring. A value of 0 starts the string at the beginning [no offset]. The ':endN' keywords specify the ending offset of the substring. A value of 3 ends the string after the 3rd character [an offset of 3 characters].

Examples

(string-not-greaterp "a" "b")                ; returns 0
(string-not-greaterp "b" "a")                ; returns NIL
(string-not-greaterp "a" "a")                ; returns 1
(string-not-greaterp "a" "A")                ; returns 1
(string-not-greaterp "A" "a")                ; returns 1
(string-not-greaterp "abc" "abc ")           ; returns 3
(string-not-greaterp "12345" "1234qr")       ; returns 4

(string-not-greaterp "J Smith" "K Smith" :start1 1 :start2 1)  ; strip off the first chars
                                                               ; returns 7

See the string-not-greaterp predicate function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next