Qstrcmp

From EDukeWiki
Revision as of 12:54, 28 May 2024 by Doom64hunter (talk | contribs) (Correct the documentation. The return value is not guaranteed to be 1 and -1 if non-equal.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

qstrcmp <quote1> <quote2> <return>

Compare two quotes. The return value is zero if they are identical, smaller than zero if the first quote comes first in lexicographical order, or greater than zero if it comes later.

Note that the return value is taken directly from the strcmp function of the C standard library, and may differ between implementations (e.g. on Windows and Linux). Do not assume that it will return any specific value, only that it is smaller, greater or equal to zero.

Also note that the lexicographical order is rudimentary, for example "Player 2" is considered greater than "Player 10".