global storage const N := 10 var n : int := N var status_not_checked : int := getarg(1,n) # a non-obvious technique! var a[1:n], b[1:n], c[1:n] : int op add() body storage() proc add() fa i := 1 to n -> c[i] := a[i] + b[i] af end add end storage resource driver() import storage writes("Enter a vector of ", n, " integers: ") fa i := 1 to n -> read(a[i]) af writes("Enter another vector of ", n, " integers: ") fa i := 1 to n -> read(b[i]) af add() writes("The sum of the two vectors is") fa i := 1 to n -> writes(" ", c[i]) af write() end driver /* ............... Example compile and run(s) % sr -o global_example global_example.sr % ./global_example Enter a vector of 10 integers: 1 3 5 7 2 4 10 8 9 11 Enter another vector of 10 integers: 1 1 1 1 1 1 1 1 1 1 The sum of the two vectors is 2 4 6 8 3 5 11 9 10 12 % ./global_example 4 Enter a vector of 4 integers: 2 4 3 5 Enter another vector of 4 integers: 1 2 3 4 The sum of the two vectors is 3 6 6 9 */