Each element is a user-derived type that can contain other user-derived types, intrinsic types, and, most importantly, a pointer of the element type. The last element's pointer will be nullified to alert the user that there's no more data.
If you use the detailed knowledge of the element structure, this is straight forward to implement. The disadvantage is that any changes in the structure (say you want to add a member or change one) reflects itself in code changes not isolated to the MODULE. This can be mitigated by providing object-like ``methods'' that hide the details. There is little performance penalty since such routines will in-line with good optimizing compilers. The coding becomes a little more difficult, but the advantages are more robust codes.
Code examples