# ENV_SearchByType

## Syntax

      #include <nitro/env.h>

      ENVResource* ENV_SearchByMember(
                 ENVResourceIter*  iter,
                 u16              type );

## Arguments

iter | Resource iterator
type | Type of resource to search for (`ENV_RESTYPE_xxx`)

## Return Values

Returns a pointer to the resource if it was obtainable. If the pointer is unobtainable, it returns `NULL`.

## Description

Searches for and gets the designated resource of the resource type.

Be sure to prepare a resource iterator in advance and initialize it with `ENV_InitIter`. By continuously searching with this iterator, you can successively get resources that match the conditions.

For more information about resource types, see the `ENV_GetType` function.

Example:
Below is an example of getting a resource of resource type `u32`.

> `ENVResourceIter iter;``
> ENVResource* p;
> ENV_InitIter( &iter );
> while( (p = ENV_SearchByType( &iter,
> ENV_RESTYPE_U32 ) ) )
> {
> OS_Printf( "resource = %s\n", p->name );
> }`

## See Also

`ENV_Init`
`ENV_GetType`
`ENV_InitIter`
`ENV_SearchByClass`
`ENV_SearchByMember`
`ENV_SearchByPartialName`
`ENV_GetLastResourceSetFromIter`

## Revision History

2005/08/18 Initial version.

CONFIDENTIAL