Ok, almost got it.  Let's say my compare functions performs
as follows:

double elem1    // variables within a record
double elem2    // variables within a record

if(elem1 <  elem2){ return -1 };
if(elem1 == elem2){ return  0 };
if(elem1 >  elem2){ return +1 };

Now my problem is this.  this is easy if I declare elem1 and elem2
but how do I refer to these as part of the record.  I know I can get
a pointer to the data within the record but am not sure how to make
the comparrison without moving the data.  I'd prefer to just refer
to these doubles, while in DB Record.

Assume fixed length record (all strings same length).
Record:
|<--string2-->|<-double1->|<-double2->|<-string2->| just as an example
^
|____ pointer to record data: UInt dataPtr;

Can I just reference these like: 

if( *(dataPtr+OffsetToDouble1) < *(dataPtr+OffsetToDouble2) )
{
    return -1;
}

Can I do something like this?  I think you get my drift.  If not
what is the correct way to compare two doubles within a Record, without
copying them to another location.

Thanks


----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to