# STATSTRM -- Statistics of n-dim vector from a file or input stream procedure t_statstrm () pointer input # Input int n # Dimension of vectors int hflag # Print header int cflag # Print count int tflag # Print total int aflag # Print average int sflag # Print standard deviation int rflag # Print range pointer sp bool clgetb() int clgeti(), btoi() begin call smark (sp) call salloc (input, SZ_FNAME, TY_CHAR) call clgstr ("input", Memc[input], SZ_FNAME) n = clgeti ("ndim") hflag = btoi (clgetb ("header")) cflag = btoi (clgetb ("count")) tflag = btoi (clgetb ("total")) aflag = btoi (clgetb ("average")) sflag = btoi (clgetb ("stddev")) rflag = btoi (clgetb ("range")) call strpak (Memc[input], Memc[input], SZ_FNAME) call statstrm (Memc[input], hflag, cflag, tflag, aflag, sflag, rflag, n) call sfree (sp) end