resource fiddle_string() const WIDTH := 70, HEIGHT := 20 var line : string[WIDTH] var screen[1:HEIGHT, 1:WIDTH] : char := ([HEIGHT] ([WIDTH] ' ')) var line_length : int var where : int where := 0 do read(line) != EOF -> line_length := length(line) where++ # The following line works. # fa j := 1 to line_length -> screen[where, j] := line[j] af # But the next line is equivalent to the above. screen[where, 1:line_length] := chars(line) od if where = 0 -> stop fi fa i := 1 to where -> writes(i, ": ", screen[i], "\n") af stop end fiddle_string /* ............... Example compile and run(s) % sr -o fiddle_string fiddle_string.sr % ./fiddle_string 12345 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890 This is the last line. ^D 1: 12345 2: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789012345678 3: 90 4: This is the last line. */