| NORSYS SOFTWARE © 2012 | NETICA API | C VERSION 5.04

net_bn* GetNthNet_bn ( | int nth, environ_ns* env )

This function can be used to iterate through the nets that are currently in Netica's memory.

Start from 0, and pass successively higher values for nth, until it returns the net you are searching for.

When nth is the number of nets in memory, or larger, NULL will be returned.

Don't count on the ordering of nets to stay the same, as nets are added and removed.

Version:

Versions 2.07 and greater have this function.

See also:

NewNet_bn |  | Create a new net
ReadNet_bn |  | Read a net from file

Example:

    The following function is available in NeticaEx.c:
    // Returns the first net with 'newname', if there is one, otherwise NULL.
    #include <string.h>

    net_bn* NetNamed (const char* name){
        int nth = 0;
        net_bn* net;
        do {
            net = GetNthNet_bn (nth++, env);
        } while (net  strcmp (name, GetNetName_bn (net)) != 0);
        return net;
    }