SUB HDXSET(field$(), command$, title$, outfile$, err$) ! ! set up the input parameters and data lines, ! one line at a time. Line data is passed in field$() ! {BL:[101,5]TRUTH.B4S} {BL:[101,5]FCSERRCOM.B4S} ! {HDXDEFMAP.B4S} ! IF (field$(1%) = "START") AND (field$(2%) = "LINES") & THEN in.put%, first%, line.inp% = .true% ! print "field$(1): <";field$(1%);">" IF NOT (in.put%) & THEN do% = fn.outfile% IF field$(1%) = "OUTFILE" & \ do% = fn.iterations% IF field$(1%) = "ITERATIONS" & \ do% = fn.title% IF field$(1%) = "TITLE" & \ pipe.coeff = val(field$(2%)) IF field$(1%) = "COEFFICIENT" & \ debug% = val(field$(2%)) IF field$(1%) = "DEBUG" & \ not.finished% = .false% IF ((field$(1%) = "QUIT") OR (field$(1%) = "EXIT")) & \ help% = .true% IF field$(1%) = "HELP" OR field$(1%) = "?" & \ more.data% = .false% IF field$(1%)="DO" OR field$(1%)="GO" OR field$(1%)="QUIT" OR field$(1%) = "EXIT" & \ IF field$(1%) = "ECHO" & THEN IF field$(2%) = "" OR field$(2%) = "-1" & THEN echo% = .true% & ELSE echo% = .false% ! IF in.put% & THEN IF field$(1%) = "END" AND field$(2%) = "LINES" & THEN in.put% = .false% & \ flow.inp% = .false% ! IF in.put% & THEN IF first% & THEN first% = NOT(first%) & \ CALL OPEN.((outfile$ + ".WK1"), "W", .flows.chan%, .flows.buf.siz%) & \ flow% = 0% ! init 1 before first record & \ flows.file.open% = .true% & ELSE do% = fn.flow.inp% ! SUBEXIT ! ! ***************** FUNCTIONS ************************** ! ! ***************** fn.flow.inp% ************************** ! DEF fn.flow.inp% ! ! flow% = flow% + 1% ! ! print "in fn.flow.inp - flow: "; flow% ! loop% = val(field$(1%)) pipe% = val(field$(2%)) other.loop% = val(field$(3%)) diam = val(field$(4%)) q.lit.sec = val(field$(5%)) length = val(field$(6)) itrn.val(0%) = q.lit.sec / 1000 ! convert to cu.m.sec itrn.val(x%) = 0 FOR x% = 1% to (.num.itn.values% - 1%) ! zero the rest CALL PUT. (.flows.chan%, flowbuf$, flow%) ! FNEND ! ! *************** fn.iterations%() ************************ ! DEF fn.iterations% ! max.its% = .max.iterations% num.its% = val(field$(2%)) num.its% = .max.iterations% IF num.its% > .max.iterations% ! FNEND ! ! ***************** fn.outfile$() ************************** ! DEF fn.outfile% ! outfile$ = field$(2%) ! outfile$ = edit$(outfile$, 40%) psn.dot% = pos(outfile$, ".", 1%) outfile$ = left$(outfile$, psn.dot% - 1%) IF psn.dot% > 0% ! FNEND ! ! ***************** fn.title%() ************************** ! DEF fn.title% ! print "title$: <";title$;">" print "command$: <";command$;">" title$ = edit$(right$(command$, 6%), 8%) + CR + LF + HT + "[HDX: " + time$(0%) + " " + date$(0%) + "]" print "title$: <";title$;">" ! FNEND ! ! {BL:[101,5]FNSAW.B4S} {BL:[101,5]FNANSCHK.B4S} ! SUBEND