function err=errcheck1(n, out, fn, hfile); %checks error in n %err=1 if there is error %err=0 otherwise %prints message in the file out if there is an error %out must be opened and closed in the calling program err=0; if (length(n) == 0); fprintf(out,'error in file %s function %3d.\n', hfile, fn); quit; err=1; end;