Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>m6_evalpartial():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  m6_EvalPartial():

  Purpose:  Used to process a codeblock against all records set in a specified
            filter.

   Syntax:  m6_EvalPartial( <nHandle>, <bEvalBlock> )

    Where:  <nHandle>     --  Is a handle to a previously allocated
                              filter.

            <bEvalBlock>  --  Is a codeblock that will be evaluated against
                              each record set in the filter.  The codeblock
                              must evaluate to a logical value.

  Returns:  The number of indexed records processed.

     Note:  This function visits all records in the specified filter and
            evaluates the specified codeblock.  If the codeblock evaluates
            to .F. the record is removed from the filter, otherwise it remains
            and processing continues with the next record until all records
            have been visited.

            *Always free RYO filters that are no longer being used.*
  Example:

         #include "SIXCDX.CH"
         #include "MACHSIX.CH"

         USE Customer via "SIXCDX"

         SET INDEX TO State

         //...............create a RYO filter based on a query condition
         nHandle := m6_NewFilter( 'State = "CA" .and. Age = 25' )

         //.............................get information about the filter
         aInfo := m6_FiltInfo( nHandle )

         //...............................is filter partially optimizable?
         if  aInfo[ INFO_OPTLVL ] == OPT_PARTIAL

             //................create code block from non-indexed expression
             bNonOpt := &("{||"+ aInfo[ INFO_NONEXPR ] +"}" )

             ? "Records to process ="
             ?? aInfo[ INFO_COUNT ]

             //...............evaluate filter against non-indexed expression
             m6_EvalPartial( nHandle, bNonOpt )

         endif



See Also: m6_NewFilter() m6_FiltInfo() m6_Error()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson