cplusDBAction 4.2                                                                                        Copyright addoit GmbH 2009

 

 

5.6.2 Indexing Using a Numerical Index

 

In Picture 11: Indexing Using a Numerical Index you have a sample which iterates through the container in an array-like manner. The internal cursor remains unchanged.

 

094:    std::stringstream text;

095:

096:    // Perform a simple select on the "DeclarationType" table belonging to the

097:    // "m_pDBGenType" Table Set

098:    clsCollDeclarationType* pCollDeclType = clsDeclarationType::Select(m_pDBGenType);

099:

100:    if (pCollDeclType != NULL)

101:    {

102:       // Index the items in the collection using a numerical index

103:       for ( long lIndex = 0; lIndex < pCollDeclType->Count(); lIndex++ )

104:       {

105:          clsDeclarationType* pDeclType = pCollDeclType->ItemAt(lIndex);

106:          text << "Item number " << lIndex << ": " << pDeclType->DB_DeclarationType()

107:             << std::endl;

108:       }

109:    }

Picture 11: Indexing Using a Numerical Index

Related Topics

5.6 Table Container


Copyright (c) 1998-2009 addoit GmbH, All Rights Reserved.

www.addoit.com                                                                                                          Page 1 of 52