× 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.



Either way will work. Just a personal preference I guess.
(more comments below sample code)


If x;
Chain (field1) fileName;
ElseIf y;
Chain (field1 : field2) fileName;
ElseIf z;
Chain (field1 : field2 : field3) fileName;
Else;
Chain (field1 : field2 : field3 : field4) fileName;
EndIf;


Versus


// code here to load the klist data structure

If x;
numOfKeys = 1;
ElseIf y;
numOfKeys = 2;
ElseIf z;
numOfKeys = 3;
Else;
numOfKeys = 4;
EndIf;

Chain %kds( klistDS: numOfKeys ) fileName;

In addition, when using a kds I found that I had to do extra evals to move
the work field into the data structure subfield. For example
kds.field1 = iim.itemnumber;
kds.field2 = xyz.itemclass;
chain %kds(kds) fileName;
when I could have done
chain (iim.itemnumber : xyz.itemclass) fileName;

What about this:
chain (*blanks) fileName; // compiles fine

Too bad this is unacceptable
chain (*null) fileName; // RNF7072: KFLD at sequence number 158 is POINTER
but key field is CHAR.
Then you wouldn't have to worry about character vs numeric. You know
*LOVAL could be big negative numbers. Which may, or may not, be an issue.
Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.