// Test subrange assignments
proc main()
{
var a = ['A':'Z'].reshape(4,4,4);
var b = @a;
var c = @a;
var d = @a;
// Scalar assignment - put a hole in the array
a[1:2,1:2,1:2] = ' ';
// Matrix assignment - must match shape
b[1:2,1:2,1:2] = ['a':'z'].reshape(2,2,2);
// Incremental assignment
c[1:2,1:2,1:2] += 32;
// Incremental assignment by a matrix
d[1:2,1:2,1:2] += (1+[2,2,2].iterate());
"", a, b, c, d, '\n';
"\nNext statement should throw a ShapeCheck\n";
try {
b[1:2,1:2,1:2] = ['a':'z'].reshape(3,2,2);
}
catch (e) {
"Caught ", e, '\n';
}
}