Written August 2024
Beginning with A-Shell 7.0.1762 of August 2024, it is possible to pass an un-DIMXed array received via a .NULL initialization within a function to another function. To illustrate, the following code calls a function without passing the expected array parameter. But the function declaration defaults the array to .NULL, which effectively treats the array as if un-DIMXed.
It then passes it to fn'two(), which also treats it as un-DIMXed.
Previously the call from fn'one() to fn'two() would have generated an error.
Note that this technique is only useful if you test the extent of the received array before attempting to access it, since any such access will generate an undimensioned array error.
call fn'one()
...
function fn'one(ary1()=.NULL as ST_1)
? "Extent of ary1() = "; .extent(ary1()) ! -1
call fn'two(ary2()=ary1())
endfunction
function fn'two(ary2()=.NULL as ST_1)
? "Extent of ary2() = "; .extent(ary2()) ! -1
endfunction
History
2025 August, A-Shell 7.0.1762: Added capability, and documentation, for passing un-DIMXed arrays.