# Example Dictionary compare 004

#### Description

These examples use the compare functions to do a case-sensitive comparison of two objects of the same type. A Boolean value is returned.

#### Details

Both Dictionaries are equal.

 (compare #{dic|X: 1 Y: 2} #{dic|X: 1 Y: 2}) Returns: 0

The key-value pair of the first Dictionary is lesser than the key-value pair of the second Dictionary.

 (compare #{dic|X: 0 Y: 1} #{dic|X: 1 Y: 2}) Returns: -1

The key-value pair of the first Dictionary is lesser than the key-value pair of the second Dictionary.

 (compare #{dic|A: 1 B: 2} #{dic|X: 1 Y: 2}) Returns: -1

Notes and Hints

If you prefer a Boolean resulting from the comparison, use the compareEQ, compareNE, compareGT, compareLT functions.

#### Related Examples

Here are examples of the comparison function at work.

 BitVector compare 018 BitVector comparison 014 Boolean comparison functions 009 Brick comparison 019 Character comparison 010 Complex comparison 021 Date comparison functions 011 Dictionary compare 004 Dictionary comparison functions 004 Directory compare 005 Directory comparison functions 005 FltVector comparison functions 014 Function comparison functions 012 IntVector compare 015 IntVector comparison functions 014 List comparison 020 Matrix compare 007 Matrix comparison functions 007 NumMatrix compare 023 NumMatrix comparison functions 023 NumVector compare 016 NumVector comparison 014 Number comparison 010 ObjVector compare 017 ObjVector comparison functions 014 ObjectRepository comparison 021 ObjectRepository comparison 022 Pair comparison 019 ShortVector compare 016 ShortVector comparison functions 015 String comparison functions 001 Structure comparison functions 003 Symbol comparison functions 002 Vector compare 006 Vector comparison functions 006 Void comparison functions 008

Here is the link to the current function used in this example.

comparison

Here are a number of links to other related functions.

 compare(#void) compareEQ(#void) compareGT(#void) compareNE(#void) compareLT(#void) compareLE(#void)

#### Argument Types

Here are the links to the data types of the arguments used in this example.

 Dictionary Integer

Here are a number of links to examples having similar argument types.