List of products in product- and table build processes.

Here you will find examples to use gProducts.

List of products in product- and table build processes. The variable is defined in different script types:

All products in the gProducts list are allocated with the memory hint kListOwner. More information about product lists and products in lists can be found here.

Preconditions
#include "internal/types.h"
#include "internal/products.h"

A simple example of a table module script.

int main ()
{
    char		mg[1000];
    idtypelist::append (gProducts, 1, 0, 0, "aaa");
    stringlist::append (gMoreGroups, 
    sprintf (mg, "\"Group %d\"", idtypelist::length (gProducts)));
    idtypelist::append (gProducts, 2, 0, 0, "bbb");
    stringlist::append (gMoreGroups, 
    sprintf (mg, "\"Group %d\"", idtypelist::length (gProducts)));
    idtypelist::append (gProducts, 3, 0, 0, "ccc");
    stringlist::append (gMoreGroups, 
    sprintf (mg, "\"Group %d\"", idtypelist::length (gProducts)));
    return 0;
}

The script uses the eye-marked products of Product Pool to build the table.

#include "internal/types.h"
#include "internal/text.h"
#include "internal/products.h"
int main ()
{
    ProductList		pl	= productlist::get ("watched");
    Product			p;
    for (p = productlist::first (pl); p; p = productlist::next (pl))
    {
        idtypelist::append (gProducts,
        product::get (p, kID),
        product::get (p, kID2),
        product::get (p, kID3),
        product::gets (p, kStringID));
    }
    return 0;
}

See Also
product
Script environment

Alphabetic index HTML hierarchy of classes or Java