# quallist.inc - get quality parameter list
#
# on exit:  numqual = total number of quality params
#           modqual = number set up for modeling
#           m1 ... mn   = model params
#           DO1 ... DOn = operation flags 

READ  qualparam.inc q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12
SET numqual = {READ_STATUS}
CLOSE qualparam.inc

SET iqual = 1
WHILE {iqual} < 12                 # first reset all variables
   BEGIN
   SET m{iqual}  = " "
   IF "{TASK}" != "seaRch parms"
      SET DO{iqual} = "#"
   SET iqual = {iqual} 1 +
   END

SET modqual = 0                    # now count model variables
SET iqual = 1
WHILE {iqual} <= {numqual}
   BEGIN
   SET isf = "sc_{q{iqual}}" ISFIELD        # make sure has composite field
   IF {isf} > 0
      BEGIN
      SET isf = "lm_{q{iqual}}" ISFIELD     # and layer-model field
      IF {isf} > 0
         BEGIN
         SET modqual = {modqual} 1 +
         SET m{modqual} = {q{iqual}}
         IF "{TASK}" != "seaRch parms"
            SET DO{modqual} = " "
         END
      END
   SET iqual = {iqual} 1 +
   END

