Qstrcmp: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Doom64hunter (talk | contribs) Correct the documentation. The return value is not guaranteed to be 1 and -1 if non-equal. |
||
Line 1: | Line 1: | ||
'''qstrcmp''' <quote1> <quote2> <return> | '''qstrcmp''' <quote1> <quote2> <return> | ||
Compare two quotes. | 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 lexicographical order is rudimentary, for example "Player 2" is considered greater than "Player 10". | Note that the return value is taken directly from the <code>strcmp</code> function of the [https://en.cppreference.com/w/c/string/byte/strcmp 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". | |||
[[Category:EDuke32 specific commands]] | [[Category:EDuke32 specific commands]] | ||
[[Category:String manipulation]] | [[Category:String manipulation]] |
Latest revision as of 12:54, 28 May 2024
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".