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

rxConvertQuery

All queries used by RouteX are in hexadecimal form. This is done so that you can query unicode or binary files. While you can generate your own hexadecimal strings it is generally easiest to simply convert them to hexadecimal using rxConvertQuery. Simply pass in a regular string such as "apple & orange" and rxConvertQuery will return a string putting "apple" and "orange" in there hexadecimal forms. A hexadecimal string starts with "0x" to tell RouteX that we are starting a string and then it follows with hexadecimal numbers representing the characters. For instance the term "whale" would be represented as: "0x7768616c65".

If you have special search needs, such as searching for strings containing null characters (0x00) or unicode characters you can either write your own function to generate hex string or else use the functions rxCharToHex and rxHexToChar to help convert your query. Note that the query operators such as "&", "|" and so forth do not get converted to hexadecimal. That is the search for "white & whale" would be "0x7768697465 & 0x7768616c65".

Note that a hex string will take up at least twice as much space as the regular ASCII string. Make sure that you allocate enough space for your strings.

Synopsis

void rxConvertQuery( UCharT *HexQuery, UCharT *TextQuery )

Arguments

HexQuery The string the hex query is to be stored in. You must allocate the string.
TextQuery A string containing the query to be converted.

Returns

Nothing.

Related Functions

rxCharToHex, rxHexToChar, rxAddQuery

Example


rxQueryData   aQuery;

unsigned long querynum;



// Set up the query I'm creating

// We store the user name in the referenc and the 

// email address to forward the news to in the action.



strcpy( aQuery.Title, "Forward news on Lextek");

strcpy( aQuery.Reference, "Someone");

strcpy( aQuery.Action, "someone@Lextek.com");



// we have to convert the query to hexadecimal form

rxConvertQuery( aQuery.Query, "(lextek | onix | routex)" );



rxAddQuery( Router, &querynum, &aQuery, Status);



if( *Status < 0 )

   return;

 

Previous Main Next Home

Copyright 2000 Lextek International