begin # Begin blocking entire file for automatic inclusion function GetByOneNm(filnam, descrip, LamLoHi, vec) begin global LamDomain, NumElts vec = zeros(NumElts) TextLines = read(filnam, "int") descrip = read(filnam, "char", TextLines, 80) LamLoHi = read(filnam, "int", 1) NumData = LamLoHi(2) - LamLoHi(1) + 1 SizeNow = 0 dumb = read(filnam, "double") # This little loop and the temporary row vector "temp" # permit this function to read a data file that's all one # column or not: while SizeNow < NumData and not eof(filnam) begin temp = [] temp = read(filnam, "double") dumb = [dumb , temp] SizeNow = coldim(dumb) end # End while SizeNow < NumData if (SizeNow <> NumData) then begin msg = ["In file ", filnam, ", data count", ... " discrepancy."] errordlg(msg) end close( filnam ) Npad = [LamLoHi(1)-LamDomain(1), LamDomain(2)-LamLoHi(2)] # So... let J be index in dumb and K be index in vec K = Npad(1) + 1 # K may be negative for J = 1 to NumData begin if K>0 then vec(K) = dumb(J) K = K + 1 if K>NumElts then break end # End for J = 1 etc end # End function GetByOneNm() end # End blocking entire file for automatic inclusion