It looks like you are using SPECIAL and STARTPOS as paired dummy buffers to walk 
across the SPECIAL.PARTS, each iteration only searching the "remainder" from where you 
left off.
   That's a little counter-intuitive :)
   Maybe better nomenclature would make that more apparent.  Like Startpos and 
Currentpos ?
   I can see why you got this response however, because at first I thought you were 
wrong again Jason ;) then I read the code again and it hit me what you were doing.
Will


In a message dated 3/16/2004 6:04:48 PM Eastern Standard Time, [EMAIL PROTECTED] 
writes:

> There can, and usually are, multiple instances of the same part number.  What makes 
> a "row" unique is part number + from qty.  Thanks for pointing out the doubling up 
> of the SPECIAL.FROM.QTY assignment though.
> 
> -----Original Message-----
> From: Jeff Fitzgerald [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 16, 2004 4:28 PM
> To: 'U2 Users Discussion List'
> Subject: RE: Looking for associated multi-value algorithm...
> 
> 
> Well, the first thing I notice is that your for/next counter, SPECIALPART,
> isn't used anywhere...  Using LOCATE will search for the PART.NBR in the
> whole SPECIAL.PARTS field, so the for/next isn't needed.
> 
> Next, I notice that this assignment:
> SPECIAL.FROM.QTY=SPECIAL.REC<14,SPECIAL> is duplicated, once just before the
> IF and once just after the THEN.  One of them can probably be dropped.
> 
> Hope this helps some....
> 
> Jeff Fitzgerald
> Fitzgerald & Long, Inc.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, March 16, 2004 3:18 PM
> To: [EMAIL PROTECTED]
> Subject: Looking for associated multi-value algorithm...
> 
> 
> I'm looking for an algorithm for searching through a group of associated
> multi-value fields.  The fields are F12 (PartsList), F14 (From Qty) and F16
> (Unit Price).  I can't depend on these being in any certain order, just that
> the associated fields will be in identical order.  What I want to return is
> the Unit Price (F16) given PART.NBR and QTY.REQUESTED.  I've got a code
> snippet of what I think will work, but I'd like to get some feedback on
> it...it won't work because, there's a better way of doing this, etc.
> Thanks.
> 
> SPECIAL.PARTS = SPECIAL.REC<12>
> SPECIALCOUNT = DCOUNT(SPECIAL.PARTS,VM)
> SPECIAL.FROM.QTY.TEMP = 0
> FOR SPECIALPART = 1 TO SPECIALCOUNT
>   LOCATE PART.NBR IN SPECIAL.PARTS<1,STARTPOS> SETTING 
> SPECIAL ELSE EXIT
>   SPECIAL.FROM.QTY=SPECIAL.REC<14,SPECIAL>
>   IF SPECIAL.FROM.QTY<QTY.REQUESTED AND
> SPECIAL.FROM.QTY>=SPECIAL.FROM.QTY.TEMP THEN
>      SPECIAL.FROM.QTY = SPECIAL.REC<14,SPECIAL>
>      SPECIAL.PART.PRICE = SPECIAL.REC<16,SPECIAL>
>      TEMP.OUT = OCONV(SPECIAL.PART.PRICE,MDP) "R#12"
>      SPECIAL.FROM.QTY.TEMP = SPECIAL.FROM.QTY
>   END
>   STARTPOS = SPECIAL + 1
>   FIRST = 0
> NEXT SPECIALPART
> DATA.OUT=TEMP.OUT
> RETURN
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to