<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


CMP$ Search:

In Transient String Words in String Library

Word Name: CMP$
Type: Standard word
Data Stack Signature: -- -1|0|+1 ss: --
Return Stack Signature: --
Availability: V1.2
Description:

Performs a case-sensitive comparison of the topmost two strings [s1, s2] on the string stack, returning -1 if s1 < s2, 0 if s1 = s2 or +1 if s1 > s2.

Example:

$" red"
$" RED"
cmp$ .
swap$ cmp$ .
drop$ dup$ cmp$ .

Comment:

None

See Also: ==$? 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>