Ahh, that makes more sense.....

Whenever I do a locate for something that exists or not, I use the form of
LOCATE........THEN
  *Date found get current rate data
  <bla bla bla>
END ELSE
  *Date not found, get previous date's rate data
  <bla bla bla> - 1
END

Commenting the two cases just so that it makes sense to not only myself the
next time I look at the code, but for posterity as well.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Peter Olson
Sent: Monday, August 23, 2004 06:18
To: '[EMAIL PROTECTED]'
Subject: RE: [U2] [UD] Sorting


in ref to 'Clarify please?'

Say our record contains the rates of a widget ( attr 2 ) stored with and
associated effective dates ( attr 1 )

0001= 12345}12367}12390}12480}12590
0002= A}B}C}D}E

we want to know the rate on 12380 ( 6/10/02 )

stored in ascending order, the locate would read...

date = 12380
LOCATE date in R.RECORD< 1 > BY 'AR' SETTING POS ELSE POS -= 1
IF POS < 1 THEN POS = 1
RATE = R.RECORD< 2 , POS >

without the adjustment to POS, the pointer would point to "C" and not "B"
but stored in descending order the locate reads

LOCATE date IN R.RECORD< 1 > BY 'DR' SETTING POS ELSE NULL
RATE = R.REC0RD< 2 , POS >

we don't need to adjust the pointer ?

maybe ? just me personal preference...2cents. + tax!




This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to