HP3000-L Archives

May 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Anderson <[log in to unmask]>
Reply To:
Michael Anderson <[log in to unmask]>
Date:
Wed, 7 May 1997 15:51:00 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Igor Yasno wrote:

> When I attempt to change the value of one of the keys by calling DBDELETE /
> DBPUT, the new record ends up at the end of the chain, even though the sort
> item value has not been changed. It seems that the chain is not re-sorted
> after the call to DBPUT.

Your comment reminds of the time when a programmer here at TIW changed his
program to call DBUPDATE instead of DBDELETE/DBPUT. Then suddenly users began
calling with questions about the data being sorted differently on the review
screen they were using. The programmer was puzzled because the items that
were being sorted on the screen weren't sort items in the database, uhmm?
What could be causing this, I was asked.

Looking in the Image book (handbook from wordware):

Pg 147: The Extended sort field!

<almost a quote>

If the new entry's sort field value matches the sort field values of other
existing entries in the chain the position of the entry is determined by the
extended sort field consisting of the sort field value and all the fields
following the sort field in the entry. If the extended sort field matches
another extended sort field, or is the last field in the entry, then the
entry is sorted chronologically following the other entries with the same
extended sort field value.

So, if you want to ensure that a chain is sorted by date, and there may be
many entries with the same date, the only way to guarantee the entries will
always be added to the end of the chain is to place the date field as the
last item in the field list for that dataset.

</almost a quote>

Cheers,

Michael Anderson
Systems Programmer
TIW Corporation.

ATOM RSS1 RSS2