This final array article in this series is a specialized tip, but when needed it is very handy to have available.

In AVR Classic you could use data structures to overlay incoming values from a disk file record buffer into other values, structures, or arrays. Overlapping array techniques with packed and binary data is troublesome in .NET (because .NET doesn’t have the concept of field values being mapped contiguously in memory like AVR Classic and green-screen RPG do). The DclAliasGroup operation helps to remove the pain of mapping an incoming record buffer to an array.

For example, consider the following record format. It has twelve monthly account balance values in fields CSSales01 through CSSales12. When this record is read, you want to implicitly map these 12 record format fields into an array.

The array below is the target array into which we want to put each of the twelve monthly fields:

This line of AVR for .NET (defined in the code right after the DclArray) causes the automatic mapping of the fields into the array—implicitly each time a record is read:

With the target array and the DclAliasGroup declared, the twelve monthly balance fields are moved implicitly into the MonthlyTotals array after the record format is read. After a read operation, fields CSSales01 through CSSales12 values are in MonthlyTotal's elements 0 through 11, respectively.