tamhas
ProgressTalk.com Sponsor
Starting a new thread because the indention has gotten silly and the topic has changed several times.
Enoon said:
Is FOR FIRST better then FIND FIRST, why?
What about replacing FIND and FIND FIRSTs (there are no uniqunesses used) with
Code:
FOR FIRST <record>: END.
since the compiler allows it and the record is also available after the FOR FIRST?
Any thought about this?
--------------------------------------
FIND FIRST is deceptive since there is no way to specify a sort order. Consequently, it either needs to be a unique find, in which case the FIRST is superfluous and misleading or it it is going to return an arbitrary record out of the set with matching keys, which is silly.
FOR FIRST solves this by allowing you to specify a sort order and thus make it clear that the same record will be selected every time. However, this is also suspicious since it violates normalization rules to treat the first record in a set differently than the rest.
CAN-FIND( FIRST makes some sense since there are times when one wants to know whether or not the set is empty.
Enoon said:
Is FOR FIRST better then FIND FIRST, why?
What about replacing FIND and FIND FIRSTs (there are no uniqunesses used) with
Code:
FOR FIRST <record>: END.
since the compiler allows it and the record is also available after the FOR FIRST?
Any thought about this?
--------------------------------------
FIND FIRST is deceptive since there is no way to specify a sort order. Consequently, it either needs to be a unique find, in which case the FIRST is superfluous and misleading or it it is going to return an arbitrary record out of the set with matching keys, which is silly.
FOR FIRST solves this by allowing you to specify a sort order and thus make it clear that the same record will be selected every time. However, this is also suspicious since it violates normalization rules to treat the first record in a set differently than the rest.
CAN-FIND( FIRST makes some sense since there are times when one wants to know whether or not the set is empty.