Re: Need help with user-written routine in SOR$

briggs_at_encompasserve.org
Date: 01/04/05


Date: 4 Jan 2005 07:23:26 -0600

In article <1104825470.751996.158350@f14g2000cwb.googlegroups.com>, hoefelmeyer@hotmail.com writes:
>
> Dave Froble wrote:
>> hoefelmeyer@hotmail.com wrote:
>> > don't have a clue what those structures consist of.
>>
>>
>> A word.
>>
> No, a word is not the same as a word structure.
> Thanks for giving it a shot, though.

Dollars to doughnuts, a "word structure" is a structure consisting
of exactly one field which is a 16 bit unsigned word in this context.

If you don't have a clue, don't spit on those that you are offered.

For reference, here's the relevant extract from the grey wall:

<<begin quote>>

user_equal

OpenVMS usage: procedure
type: procedure value
access: function call
mechanism: by reference

User-written routine that resolves the sort order when records have duplicate
keys. (This argument is not currently supported by the high-performance
Sort/Merge utility.) The user_equal argument is the address of the procedure
value for this user-written routine. If you specify SOR$M_STABLE or
SOR$M_NODUPS in the options argument, do not use this argument.
SORT/MERGE calls the duplicate key routine with five reference
arguments

---ADRS1, ADRS2, LENG1, LENG2, CNTX---

corresponding to the addresses
of the two records that compare equally, the lengths of the two records that
compare equally, and the context longword. The LENG1 and LENG2 arguments are
addresses that point to 16-bit word structures that contain the length
information.

<<end quote>>

I take that to mean that

ADRS1 is one record contents by reference

ADRS2 is the other record contents by reference

LENG1 is a 16 bit word containing the length of the one record by reference

LENG2 is a 16 bit word containing the length of the other record by reference

CNTX is an unininterpreted argument. The type and mechanism you choose
when you pass it in SOR$BEGIN_SORT should match the ones you use when
you retrieve it in your user equal routine.

        John Briggs