× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Barbara Morris wrote on 28/02/2007 07:54:42 PM:

You could use a list of keyfields like 
Dennis suggested; but I think the keyds is _slightly_ better than a list 

of keyfields _in this case_, since it's a bit easier to see that the 
same key ds is being used for each CHAIN in the group (only one name to 
check vs a list of 3 names or values).

I'm glad I re-read your message more carefully, because on first skim I 
thought "Why KDS instead of (keyFld1 : keyFld2 : keyFld3)".

D keyds         e ds        extname(file:*key)
  /free
    keyds.fld1 = something;
    keyds.fld2 = somethingelse;
    keyds.fld3 = whatever;
    chain %kds(keyds:3) file;
    if %found
       ...
    else;
       chain %kds(keyds:2) file;
       if %found
           ...
       else;
          chain %kds(keyds:1) file;

I also thought of another way that this could lend itself to being better 
than a list of key fields.  Consider:

for numToCheck = NUM_KEY_FIELDS down to 1;
    chain %kds(keyDS : numToCheck);
    if (%found());
        leave;
    endif;
end for;


Firstly, if the number of key fields changes, all that is required is to 
change the NUM_KEY_FIELDS constant.  Perhaps there is even a way to 
determine the number of key fields programmatically?  Secondly, just to 
fan the flames again ... maybe this is a good case for the leave opcode? 
:)

Attention:

The information contained in this message and or attachments is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any review, retransmission, 
dissemination or other use of, or taking of any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
prohibited. If you received this message in error, please contact the sender 
and 
delete the material from any system and destroy any copies. Thank you for your 
time and consideration.

Attention: 

Le contenu de ce message et(ou) les fichiers ci-joints s?adressent 
exclusivement à la personne ou -entité à laquelle ils sont destinés. Ils 
peuvent 
contenir de l?information confidentielle, protégée et(ou) classifiée. Il est 
strictement interdit à toute personne ou entité autre que le(la) destinataire 
prévu(e) de ce message d?examiner, de réviser, de retransmettre ou de diffuser 
cette information, de prendre une quelconque action en fonction ou sur la base 
de celle-ci, ou d?en faire tout autre usage. Si vous avez reçu ce message par 
erreur, veuillez communiquer avec l?expéditeur(trice), supprimer ce message et 
les fichiers ci-inclus de tout système, et en détruire toutes copies, qu?elles 
soient électroniques ou imprimées. Nous vous remercions de votre entière 
collaboration. 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.