pascal.ijs: factored out error-checking array accessor