Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::containers::list::LIST_NEXTALL Macro
C++
#define LIST_NEXTALL( l, i, t, v ) if(l)            \
    for( ++(i),((v)=(t)NULL); ((i) < ((l)->Cnt))? \
    (((v)=(t)(l)->pNode[i]),1):(((v)=(t)NULL),0); (i)++ )  if( v )
Parameters 
Description 
list 
Description 
index 
index variable for stepping through the list 
type 
type of the members in the list
pointer 
variable name to use to store the the current list element. 

This can be used to continue iterating through a list after a LIST_FORALL has been interrupted.

PLIST pList = NULL;
CTEXTSTR p;
INDEX idx;
   
AddLink( &pList, "this" );
AddLink( &pList, "is" );
AddLink( &pList, "a" );
AddLink( &pList, "test" );
   
LIST_FORALL( pList, idx, CTEXTSTR, p )
{
    if( strcmp( p, "is" ) == 0 )
        break;
}
LIST_NEXTALL( pList, idx, CTEXTSTR, p )
{
    printf( "remaining element : %s", p );
}
j 
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!