RouteX Document Router Toolkit
Main Functions Types & Errors Query Language Demo Home

rxGetNextHit

Returns the next document to route. It also returns the query information for the query routing this document. Thus it will return the action, reference, title and query itself for this document. Note that the document returned is whatever string you stored with rxStartDocument. Using the document text and the action text your application can take whatever action is necessary on the file. This might consist of copying it to a backup location, emailing it to a specific address, printing it out, etc.

You will call rxGetNextHit to iterate through all the hits. Note though that to start iterating again through the hits you must call rxGetFirstHit. The hitswill remain until a new batch is started. If there are no more hits then *Status will contain EndOfHitList. You should check *Status for this value and not just if *Status is less than 0.

The Query argument is a pointer to an rxQueryData struct as with rxAddQuery or rxFindQuery.

typedef struct rxQueryData {

   UCharT Query[1024];

   UCharT Title[1024];

   UCharT Reference[1024];

   UCharT Action[1024];

}

Synopsis

void rxGetFirstHit( RouteX Router, char *document, rxQueryData *Query, StatusCodeT *Status )

Arguments

Router The RouteX object you are deleting
document A pointer to a null terminated string. You must allocate this variable.
Query A pointer to a rxQueryData struct containing the query information that found this document, including the action to be taken on it. You must allocate this variable.
Status A pointer to a value of type StatusCodeT. If an error occurs during the execution of the function a value representing the error will be stored in *Status. You should check *Status after every function call.

Returns

Nothing.

Related Functions

rxAddQuery, rxGetFirstHit

Example


rxQueryData   aQuery;

char          document[255];



rxGetFirstHit( Router, document, &aQuery, Status );





if( ( *Status < 0 ) || ( *Status == EndOFHitList ) )

   return;



// iterate through all the other routing



while( *Status == 0 ) {



   // a function you'd write to act on the routing information

   TakeAction( document, aQuery.Action );



   rxGetNextHit( Router, document, &aQuery, Status );  

}

  

 

Previous Main Next Home

Copyright 2000 Lextek International