[ Recorded Database | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

# recorda(+Key, ?Value)

Records the term Value at the beginning of key Key in the indexed database.

Key
  An atom or compound term.
Value
  Any prolog term.

## Description

Used to record any prolog term Value at the beginning of the indexed database entry associated with the key Key. In the case of compound terms, all keys of the same name and arity are treated as equal.

If backtracking occurs through the call of recorda/2 the associated Value is not removed from the indexed database.

### Modes and Determinism

- recorda(+, ?) is det

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

### Exceptions

(4) instantiation fault
  Key is not instantiated.
(5) type error
  Key is neither an atom nor a compound term.

## Examples

       Success:
        recorda(a(compound,term),value1).
        recorda([a,compound,term],value2).

        [eclipse]: recorda(whiskey,jameson),
        >        recorda(whiskey,bushmills),
        >        recorda(whiskey,glenlivet).
        yes.
        [eclipse]: recorded(whiskey,Value).
        Value = glenlivet     More (;)
        Value = bushmills     More (;)
        Value = jameson     More (;)
        no (more) solution.
    Error:
        recorda(Key, anything).             (Error 4)
        recorda("key",anything).            (Error 5)

## See Also

record / 2, recordz / 2