Sack Library Documentation
ContentsIndexReferenceHome
Example
POINTER p;  // the pointer to receive the list member pointer (should be a user type)
INDEX idx; // indexer
PLIST pList; // some list.
   
LIST_FORALL( pList, idx, POINTER, p )
{
    // p will never be NULL here.
    // each link stored in the list is set to p here..
   
    // this is a way to remove this item from the list...
    SetLink( &pList, idx, NULL );
   
    if( some condition )
       break;
}
   

Another example that uses data and searches..

PLIST pList = NULL;
INDEX idx;
CTEXTSTR string;
   
AddLink( &pList, (POINTER)"hello" );
AddLink( &pList, (POINTER)"world" );
   
LITS_FORALL( pList, idx, CTEXTSTR, string )
{
    if( strcmp( string, "hello" ) == 0 )
        break;
}
// here 'string' will be NULL if not found, else will be what was found
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.