resource array_record_field() # `num' must be a constant; if not get # line 7: fatal: non-constant array bounds in spec or record # var num : int := 5; getarg(1, num) # write("the number is", num) const num := 5 type array_type = [1:num] real # line 7 type rec_type = rec(slot : int, list : array_type) var y : rec_type y := rec_type(3, (3.5, 5.4, 7.3, 9.2, 1.1)) fa i := 1 to num -> writes(" ", y.list[i]) af write() write(y.slot, y.list[y.slot]) end array_record_field /* ............... Example compile and run(s) % sr -o array_record_field array_record_field.sr % ./array_record_field 3.50000 5.40000 7.30000 9.20000 1.10000 3 7.30000 */