wiki:Documentation/ARexxAPI/ADDRFIND

Version 1 (modified by AmigaPhil, 12 months ago) (diff)

--

ADDRFIND

NAME

AddrFind -- Find one or more entries in the address book. (V2.0)

TEMPLATE

VAR/K,STEM/K,PATTERN/A,NAMEONLY/S,EMAILONLY/S

FUNCTION

Finds one or more entries in the address book, searching by default in the "Alias", "Real name", "E-mail address", "Description", "Street", "City" and "Country" fields.

INPUTS

VAR/K - variable to store the results of the query
STEM/K - base name used for the stems where the aliases for the address book entries matching the query will be stored
PATTERN/A - pattern used as search criterion; all the AmigaDOS wildcard characters are supported
NAMEONLY/S - restrict the search to the "Real name" field of the entries in the address book
EMAILONLY/S - restrict the search to the "E-mail address" field of the entries in the address book

RETURNS

VAR - string containing the number of entries matching the query and a space separated list of the matching aliases.
<stem>ALIAS.COUNT - number of matches found
<stem>ALIAS.NR - the nth alias in the list of aliases matching the query, nr being a number between 0 and n-1.

RC is set to 5 if no match is found.

NOTES

Aliases are returned in the order they appear in the address book.

EXAMPLE

/* Enable result codes */

OPTIONS RESULTS

/* Find all the entries using a given provider */

ADDRFIND PATTERN '#?@saug.org' STEM st. EMAILONLY

/* List results */

IF RC = 0 THEN

DO i = 0 TO st.alias.count-1

SAY 'Match #'i+1': 'st.alias.i

END

ELSE

SAY 'No matches found.'

EXIT

BUGS

AddrFind can't search into the "Alias" or "Description" fields of groups.

SEE ALSO

ADDRRESOLVE ?