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



Cool..... 2x Chris!!

John

<snip>
Another advantage is that these definitions can be in sub procedures.
CTDATA is always global.


You do want to be careful with "Ascend' on these types of data structures
because Ascend kicks the lookup into a Binary tree lookup. You must sort
the values as you load them in the source. Otherwise the lookup may fail
even though the element exists in the list.


You can also use the definition from the array on the sub elements. Makes
it easier for when you suddenly decide they all need to be longer.

dcl-ds *N;
*N Like(OkList) Inz('CPF3C51');
*N Like(OkList) Inz('CPF3C52');
*N Like(OkList) Inz('CPF3C53');
*N Like(OkList) Inz('CPF3C54');
*N Like(OkList) Inz('CPF3C55');
OkList Char(7) Dim(5) Pos(1) Ascend;
end-ds;


And you are not limited to one array wide.

Dcl-Ds *N;
*N Like(Sorts) INZ('DDescription,Upc');
*N Like(Sorts) INZ('UUPC');
*N Like(Sorts) INZ('SSize, Upc');
*N Like(Sorts) INZ('CCategory Dpt/Cat/Sub');
*N Like(Sorts) INZ('IItem Code');
*N Like(Sorts) INZ('AAlt Item Code');
*N Like(Sorts) INZ('PCase Pack, UPC');
Sorts Char(26) POS(1) DIM(7);
Sortkey Char(1) OVERLAY(Sorts);
Sortdesc Char(25) OVERLAY(Sorts:*NEXT);
End-Ds;

IF %LOOKUP(S0SORT:SortKey) = 0;
*IN89 = *ON;
CALLP MSGSEND('ERR9996':'Invalid sort by.');
ELSE;
S0SORTDESC = SortDesc( %LOOKUP(S0SORT:SortKey));
Endif;
</snip>
<br />
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.

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.