beetlebug▾
/

text compare

Compares two indices.

PATHNAME compare INDEX1 OP INDEX2

Description

OP is <, <=, ==, >=, >, or !=. Gives 1 when the place of INDEX1 has that relation to the place of INDEX2, and 0 when it does not.

Returns

1 or 0.

Examples

% text .cm
> .cm insert end "abc\ndef"
> .cm compare 1.0 < 2.0
1

Errors

% text .cm2; .cm2 compare 1.0 << 2.0
bad comparison operator "<<": must be <, <=, ==, >=, >, or !=
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also