Forum Discussion

FICO's avatar
FICO
Community Manager
14 years ago

association containsKey

association containsKey

Is there a method like containsKey on an association?

Or do I need to do:

if (oneAssociation["key1"] is not null)then ...

now I end up with:

if ( oneAssociation["key1"] is not null and anotherAssociation["key2"] is not null and oneAssociation["key1"] = anotherAssociation["key2"])then {

Or is there a better way?

2 Replies

  • FICO's avatar
    FICO
    Community Manager

    look at the "online" documentation and search association.

    looks like there is a contians(entitiy) and is Contained[entity] which might make things easier.

    hope this helps some.

  • FICO's avatar
    FICO
    Community Manager

    No these work on entity, the "value" in the "key-value" pair.

    If you look at HashTable.contains and containsKey you see that for contains it states:

    "This operation is more expensive than the containsKey method"

    So I'm looking for the least expensive check.