# find-registry(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

find-registry - Index search of a registry sub-tree.

## SYNOPSIS

find-registry "root" index

## DESCRIPTION

find-registry performs an indexed search of a registry sub-tree allowing the caller to determine the names of the children that exist as sub-nodes of the specified node. root defines position in the hierarchy whose children are to be determined. index is a value from `0..n` and identifies the index number of the child node. The name of the child node is returned in $result(5) if one exists, otherwise an error status is returned.

## EXAMPLE

The following example comes from `addrbook.emf` and shows how find-registry is used to iterate through entries in the address book. Note that find-registry is used with !force(4) and the $status(5) of the call is tested to determine if the invocation succeeded.

    !force find-registry "/AddressBook/Names" #l0
    !if $status
        set-variable #l1 $result
        76 insert-string "_"
        2 newline
        insert-string &spr "Section: %s" #l1
        newline
        ; Iterate through all of the entries.
        set-variable #l2 0

        !repeat
            !force #l2 ab-buffer
            !if $status
                set-variable #l2 &add #l2 1
            !endif
        !until &not $status
        set-variable #l0 &add #l0 1
        !goto next
    !endif

## SEE ALSO

copy-registry(3), delete-registry(2), list-registry(2), mark-registry(2), read-registry(2), set-registry(2), &reg(4), erf(8).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>