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



Scott Klement wrote:
> ...
> c) Instead of using from/to notation for the data structures, consider
> using length notation.  I shudder to think of the amount of work it'd take
> to fix one of these structures if it were defined wrong.
> ...

The (sort of) good thing about from/to notation is that you can see that
the subfield is defined starting in the right place.  I find that
defining API structures using only length notation makes it difficult to
debug problems with the structure, especially if it has a lot of
subfields.  But I hate from/to notation because it's hard (for me at
least, because I hate subtracting) to see that the data type is correct.

Using length notation with OVERLAY makes it easy to see that both the
data type and the starting position match the API documentation.

For example

DQIMI0100         DS                     inz
D StructLen                     10I 0    overlay(QIMI0100 :1)
D                                        inz(101)
D StructFmt                      8A      overlay(QIMI0100 :5) 
D                                        inz('IMGI0100')
D ResX00_1                      10A      overlay(QIMI0100 :13) 
D                                        inz(*allx'00')
D ResX00_2                      10A      overlay(QIMI0100 :23) 
D                                        inz(*allx'00')
D DataStrmFmt                   10I 0    overlay(QIMI0100 :33) 
D PhotoI                        10I 0    overlay(QIMI0100 :37) 
D ResUnit                       10I 0    overlay(QIMI0100 :41) 
 ...


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.