#used to read in project data (eg: sced=3) using a text file function readData(filename, data, model) { while ((getline < "grammars/data.txt")) { if ($1 ~ /^[ /t]*#/) { continue } #skip comments if ($0 ~ /^[ /t]*$/) { continue } #skip blank lines #is this a valid key from the model? #is the range provided within bounds? if(model[getAlias($2)]) { if(index(model[getKeys()], $1)) { if (model[getAlias($2)] >= model[getRangeMin($1)]) { if (model[getAlias($2)] <= model[getRangeMax($1)]) { data[getRating($1)] = model[getAlias($2)] } else {err($2 " is above the allowed range for " $1)} } else {err($2 " is below the allowed range for " $1 )} } else {err("key named \"" $1 "\" in input data not found in model")} } else {err("input value of " $2 " not a valid value for " $1)} } close("grammars/data.txt") }