# test slicing of arrays of chars and strings

resource cslice ()
    char v[5] = chars ("12345")
    char g[5][5] = ((
	chars("abcde"),
	chars("fghij"),
	chars("klmno"),
	chars("prstu"),
	chars("vwxyz")))

    write (g[5])
    write (g[*,2])
    g[*,3] = v
    write (g[4])
    write ()

    string[5] s[5,5], t[5]
    for [ i = 1 to 5 ] {
	for [ j = 1 to 5 ] {
	    s[i,j] = "<" || string(100*i+j) || ">"
	}
    }

    t = s[*,2]
    s[*,4] = t

    for [ i = 1 to 5 ] {
	for [ j = 1 to 5 ] {
	    printf ("s[%d,%d] = %s\n", i, j, s[i,j])
	}
    }
end
