===========================================================
                                      .___ __  __   
          _________________  __ __  __| _/|__|/  |_ 
         / ___\_` __ \__  \ |  |  \/ __ | | \\_  __\
        / /_/  >  | \// __ \|  |  / /_/ | |  ||  |  
        \___  /|__|  (____  /____/\____ | |__||__|  
       /_____/            \/           \/           
              grep rough audit - static analysis tool
                  v2.8 written by @Wireghoul
=================================[justanotherhacker.com]===
nutsqlite-2.0.6/updateNUT.tcl-1731- 
nutsqlite-2.0.6/updateNUT.tcl:1732: thread::send -async $::SQL_THREAD {db eval {select code from z_tcl_code where name = 'InitialLoad_alt_GUI'} { } ; eval $code}
nutsqlite-2.0.6/updateNUT.tcl-1733- } else {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3283-  if {$ld == ""} {return}
nutsqlite-2.0.6/updateNUT.tcl:3284:  db eval {select Shrt_Desc, food_des.NDB_No as NDB_No, Gm_Wgt from food_des natural join pref_Gm_Wgt where Long_Desc = $ld limit 1} {
nutsqlite-2.0.6/updateNUT.tcl:3285:   db eval {select count(*) as alreadythere from mealfoods where NDB_No = $NDB_No and meal_id = $::currentmeal} {
nutsqlite-2.0.6/updateNUT.tcl-3286-    if {$alreadythere == 0} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3317-
nutsqlite-2.0.6/updateNUT.tcl:3318:db eval {select Shrt_Desc, food_des.NDB_No as NDB_No, Gm_Wgt from food_des natural join pref_Gm_Wgt where food_des.NDB_No = $::NDB_Novf limit 1} {
nutsqlite-2.0.6/updateNUT.tcl-3319- db eval {insert or replace into mealfoods values ($::currentmeal, $NDB_No, $Gm_Wgt, null)}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3350-  dropoutvf
nutsqlite-2.0.6/updateNUT.tcl:3351:  db eval {select NDB_No as NDB_Novf from food_des where Long_Desc = $ld limit 1} { }
nutsqlite-2.0.6/updateNUT.tcl-3352-  db eval {insert into z_tcl_jobqueue values (null, 'view_foods', $NDB_Novf, null, null)}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3354-  set Long_Desc $ld
nutsqlite-2.0.6/updateNUT.tcl:3355:  db eval {select case when Refuse is not null then Refuse || "%" else Refuse end as Refusevf, setRefDesc(Ref_desc) from food_des where NDB_No = $NDB_Novf} { }
nutsqlite-2.0.6/updateNUT.tcl:3356:  db eval {select cast(round(Gm_Wgt) as int) as gramsvf, round(8.0 * Gm_Wgt / 28.35, 0) / 8.0 as ouncesvf, cast(round(Gm_Wgt * 0.01 * Nutr_Val) as int) as caloriesvf, round(8.0 * Amount, 0) / 8.0 as Amountvf, Msre_Desc as Msre_Descvf, 28.349523 as ounce2gram, case when Nutr_Val is null or Nutr_Val = 0.0 then 0.0 else 100.0/Nutr_Val end as cal2gram, origGm_Wgt/origAmount as Amount2gram from pref_Gm_Wgt join nut_data using (NDB_No) where NDB_No = $NDB_Novf and Nutr_No = 208} { }
nutsqlite-2.0.6/updateNUT.tcl:3357:  set servingsizes [db eval {select distinct Msre_Desc from weight where NDB_No = $NDB_Novf order by Seq limit 100 offset 1}]
nutsqlite-2.0.6/updateNUT.tcl-3358-  .nut.vf.cb configure -values $servingsizes
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3389-
nutsqlite-2.0.6/updateNUT.tcl:3390:db eval {select n6balance, macropct from z_tcl_n6hufa natural join z_tcl_macropct where NDB_No = $::NDB_Novf} {
nutsqlite-2.0.6/updateNUT.tcl-3391- thread::send -async $::GUI_THREAD [list set ::FAPU1vf $n6balance]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3402-
nutsqlite-2.0.6/updateNUT.tcl:3403:db eval {select cast(round($::Gm_Wgtvf * 0.01 * Nutr_Val) as int) as CHO_NONFIBvf1 from nut_data where NDB_No = $::NDB_Novf and Nutr_No = 2000} {
nutsqlite-2.0.6/updateNUT.tcl-3404- thread::send -async $::GUI_THREAD [list set ::CHO_NONFIBvf1 $CHO_NONFIBvf1]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3422-
nutsqlite-2.0.6/updateNUT.tcl:3423:db eval {delete from z_tcl_jobqueue where jobtype = 'view_foods_Gm_Wgt' and jobnum <= $jobnum}
nutsqlite-2.0.6/updateNUT.tcl-3424-
nutsqlite-2.0.6/updateNUT.tcl-3425-if {$::Gm_Wgtvf > 0.0} {
nutsqlite-2.0.6/updateNUT.tcl:3426: db eval {update pref_Gm_Wgt set Gm_Wgt = $::Gm_Wgtvf where NDB_No = $::NDB_Novf}
nutsqlite-2.0.6/updateNUT.tcl-3427- }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3438-
nutsqlite-2.0.6/updateNUT.tcl:3439:db eval {select cast(round($::Gm_Wgtvf * 0.01 * Nutr_Val) as int) as CHO_NONFIBvf1 from nut_data where NDB_No = $::NDB_Novf and Nutr_No = 2000} {
nutsqlite-2.0.6/updateNUT.tcl-3440- thread::send -async $::GUI_THREAD [list set ::CHO_NONFIBvf1 $CHO_NONFIBvf1]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3455- set NDB_Novf $::NDB_Novf
nutsqlite-2.0.6/updateNUT.tcl:3456: set ld {*}[db eval {select Long_Desc from food_des where NDB_No = $::NDB_Novf}]
nutsqlite-2.0.6/updateNUT.tcl-3457- .nut.vf.meal configure -state normal
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3460- thread::send -async $::SQL_THREAD {job_view_foods}
nutsqlite-2.0.6/updateNUT.tcl:3461: db eval {select case when Refuse is not null then Refuse || "%" else Refuse end as Refusevf, setRefDesc(Ref_desc), Long_Desc from food_des where NDB_No = $::NDB_Novf} { }
nutsqlite-2.0.6/updateNUT.tcl:3462: db eval {select cast(round($::Gm_Wgtvf) as int) as gramsvf, round(8.0 * $::Gm_Wgtvf / 28.35, 0) / 8.0 as ouncesvf, cast(round($::Gm_Wgtvf * 0.01 * Nutr_Val) as int) as caloriesvf, round(8.0 * $::Gm_Wgtvf / origGm_Wgt * origAmount, 0) / 8.0 as Amountvf, Msre_Desc as Msre_Descvf, 28.349523 as ounce2gram, case when Nutr_Val is null or Nutr_Val = 0.0 then 0.0 else 100.0/Nutr_Val end as cal2gram, origGm_Wgt/origAmount as Amount2gram from pref_Gm_Wgt join nut_data using (NDB_No) where NDB_No = $::NDB_Novf and Nutr_No = 208} { }
nutsqlite-2.0.6/updateNUT.tcl:3463: set servingsizes [db eval {select distinct Msre_Desc from weight where NDB_No = $::NDB_Novf order by Seq limit 100 offset 1}]
nutsqlite-2.0.6/updateNUT.tcl-3464- .nut.vf.cb configure -values $servingsizes
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3805-   } elseif {$::vitminpo == 0} {
nutsqlite-2.0.6/updateNUT.tcl:3806:   set ::${nuttag}opt [db eval {select dv_default from nutr_def where Tagname = $nuttag}]
nutsqlite-2.0.6/updateNUT.tcl-3807-   .nut.po.pane.optframe.vite_s configure -state normal -textvariable ::${nuttag}opt
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3900- db eval {drop view if exists pcf}
nutsqlite-2.0.6/updateNUT.tcl:3901: if {[db eval {select count(*) from mealfoods where meal_id = $::currentmeal}] > 0} {
nutsqlite-2.0.6/updateNUT.tcl-3902-  set selectstring "select * from ("
nutsqlite-2.0.6/updateNUT.tcl-3903-  set viewstring "drop view if exists pcf; create temp view pcf as select * from ("
nutsqlite-2.0.6/updateNUT.tcl:3904:  db eval {select NDB_No from mealfoods where meal_id = $::currentmeal} {
nutsqlite-2.0.6/updateNUT.tcl-3905-   if {$::GRAMSopt} {
nutsqlite-2.0.6/updateNUT.tcl:3906:    append selectstring "(select cast (round(Gm_Wgt) as integer) as \"::${NDB_No}\" from mealfoods where NDB_No = $NDB_No and meal_id = $::currentmeal), "
nutsqlite-2.0.6/updateNUT.tcl-3907-    } else {
nutsqlite-2.0.6/updateNUT.tcl:3908:    append selectstring "(select round(8.0 * Gm_Wgt / 28.349523,0) / 8.0 as \"::${NDB_No}\" from mealfoods where NDB_No = $NDB_No and meal_id = $::currentmeal), "
nutsqlite-2.0.6/updateNUT.tcl-3909-    }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3911-    if {$::GRAMSopt} {
nutsqlite-2.0.6/updateNUT.tcl:3912:     append viewstring "(select cast (round(Gm_Wgt) as integer) as \"::${NDB_No}\" from mealfoods where NDB_No = $NDB_No and meal_id = $::currentmeal), "
nutsqlite-2.0.6/updateNUT.tcl-3913-     } else {
nutsqlite-2.0.6/updateNUT.tcl:3914:     append viewstring "(select round(8.0 * Gm_Wgt / 28.349523,0) / 8.0 as \"::${NDB_No}\" from mealfoods where NDB_No = $NDB_No and meal_id = $::currentmeal), "
nutsqlite-2.0.6/updateNUT.tcl-3915-     }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-3962- if {$dbdelete} {
nutsqlite-2.0.6/updateNUT.tcl:3963:  db eval {delete from currentmeal where NDB_No = $ndb}
nutsqlite-2.0.6/updateNUT.tcl-3964-  thread::send -async $::SQL_THREAD {job_daily_value_refresh}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4155-  upvar #0 $storynut ::newstory
nutsqlite-2.0.6/updateNUT.tcl:4156:  db eval {select Tagname, case when Units != X'B567' then Units else 'mcg' end as Units from nutr_def where NutrDesc = $::newstory} { }
nutsqlite-2.0.6/updateNUT.tcl-4157-  .nut tab .nut.ts -text [list The {*}$::newstory Story]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4163-  } else {
nutsqlite-2.0.6/updateNUT.tcl:4164:  db eval {select Tagname, case when Units != X'B567' then Units else 'mcg' end as Units from nutr_def where NutrDesc = $::newstory} { }
nutsqlite-2.0.6/updateNUT.tcl-4165-  .nut.ts.frranking.ranking delete [.nut.ts.frranking.ranking children {}]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4169- set FdGrp_Cd 0
nutsqlite-2.0.6/updateNUT.tcl:4170: db eval {select FdGrp_Cd from fd_group where FdGrp_Desc = $::fdgroupchoice} { }
nutsqlite-2.0.6/updateNUT.tcl-4171-
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4180- if {$::rankchoice == "Foods Ranked per 100 Grams"} {
nutsqlite-2.0.6/updateNUT.tcl:4181:  set storydata [db eval { select fd.NDB_No, 100, Shrt_Desc, monoright(case when $::GRAMSopt = 1 then '100 g' else '3.5 oz' end, 10), case when $screen = 0 then monoright(cast(round(100.0 * data.Nutr_Val / dv, 0) as int) || '% DV', 14) else monoright(round(data.Nutr_Val, 1) || ' ' || $Units, 14) end as Nutr_Val from food_des fd join nutr_def nd join nut_data data on fd.NDB_No = data.NDB_No and nd.Nutr_No = data.Nutr_No and data.Nutr_Val > 0.0 left join am_dv on nd.Nutr_No = am_dv.Nutr_No where Tagname = $Tagname and FdGrp_Cd = case when $FdGrp_Cd = 0 then FdGrp_Cd else $FdGrp_Cd end order by Nutr_Val desc }]
nutsqlite-2.0.6/updateNUT.tcl-4182-
nutsqlite-2.0.6/updateNUT.tcl-4183-  } elseif {$::rankchoice == "Foods Ranked per 100 Calories"  && $Tagname != "ENERC_KCAL" && $Tagname != "ENERC_KJ"} {
nutsqlite-2.0.6/updateNUT.tcl:4184:  set storydata [db eval { select fd.NDB_No, 10000.0 / cals.Nutr_Val, Shrt_Desc, monoright(case when $::GRAMSopt = 1 then cast(round(10000.0 / cals.Nutr_Val) as int) || ' g' else round(10000.0 / cals.Nutr_Val / 28.249523,1) || ' oz' end, 10), case when $screen = 0 then monoright(cast(round(data.Nutr_Val / dv * 10000.0 / cals.Nutr_Val, 0) as int) || '% DV', 14) else monoright(round(data.Nutr_Val * 100.0 / cals.Nutr_Val, 1) || ' ' || $Units, 14) end as Nutr_Val from food_des fd join nut_data cals on fd.NDB_No = cals.NDB_No and cals.Nutr_No = 208 and cals.Nutr_Val > 0.0 join nutr_def nd join nut_data data on fd.NDB_No = data.NDB_No and nd.Nutr_No = data.Nutr_No and data.Nutr_Val > 0.0 left join am_dv on nd.Nutr_No = am_dv.Nutr_No where Tagname = $Tagname and FdGrp_Cd = case when $FdGrp_Cd = 0 then FdGrp_Cd else $FdGrp_Cd end order by Nutr_Val desc }]
nutsqlite-2.0.6/updateNUT.tcl-4185-
nutsqlite-2.0.6/updateNUT.tcl-4186-  } elseif {$::rankchoice == "Foods Ranked per Daily Recorded Meals"} {
nutsqlite-2.0.6/updateNUT.tcl:4187:  set storydata [db eval { select mf.NDB_No, sum(Gm_Wgt / mealcount * meals_per_day), Shrt_Desc, monoright(case when $::GRAMSopt = 1 then cast(round(sum(Gm_Wgt / mealcount * meals_per_day)) as int) || ' g' else round(sum(Gm_Wgt / mealcount * meals_per_day / 28.35), 1) || ' oz' end, 10), case when $screen = 0 then monoright(cast(round(sum(Gm_Wgt * Nutr_Val / dv / mealcount * meals_per_day), 0) as int) || '% DV', 14) else monoright(round(sum(Gm_Wgt * Nutr_Val / 100.0 / mealcount * meals_per_day), 1) || ' ' || $Units, 14) end as Nutr_Val from mealfoods mf join food_des using (NDB_No) join nutr_def nd join nut_data data on mf.NDB_No= data.NDB_No and nd.Nutr_No = data.Nutr_no and data.Nutr_Val > 0.0 left join am_dv on nd.Nutr_No = am_dv.Nutr_No join am_analysis_header where meal_id >= firstmeal and Tagname = $Tagname and FdGrp_Cd = case when $FdGrp_Cd = 0 then FdGrp_Cd else $FdGrp_Cd end group by mf.NDB_No, NutrDesc order by Nutr_Val desc }]
nutsqlite-2.0.6/updateNUT.tcl-4188-
nutsqlite-2.0.6/updateNUT.tcl-4189-  } elseif {$::rankchoice == "Foods Ranked per one approximate Serving"} {
nutsqlite-2.0.6/updateNUT.tcl:4190:  set storydata [db eval {select fd.NDB_No, cast (round(water.Nutr_Val) as int), Shrt_Desc, monoright(case when $::GRAMSopt = 1 then cast(round(water.Nutr_Val) as int) || ' g' else round(water.Nutr_Val / 28.249523,1) || ' oz' end, 10), case when $screen = 0 then monoright(cast(round(data.Nutr_Val / dv * water.Nutr_Val, 0) as int) || '% DV', 14) else monoright(round(data.Nutr_Val / 100.0 * water.Nutr_Val, 1) || ' ' || $Units, 14) end as Nutr_Val from food_des fd join nut_data water on fd.NDB_No = water.NDB_No and water.Nutr_No = 255 and water.Nutr_Val > 0.0 join nutr_def nd join nut_data data on fd.NDB_No = data.NDB_No and nd.Nutr_No = data.Nutr_No and data.Nutr_Val > 0.0 left join am_dv on nd.Nutr_No = am_dv.Nutr_No where Tagname = $Tagname and FdGrp_Cd = case when $FdGrp_Cd = 0 then FdGrp_Cd else $FdGrp_Cd end order by Nutr_Val desc }]
nutsqlite-2.0.6/updateNUT.tcl-4191-  }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4208-
nutsqlite-2.0.6/updateNUT.tcl:4209: catch {.nut.ts.frgraph.canvas create line [db eval { with meals (meal_id, Nutr_Val) as (select meal_id, sum(Gm_Wgt * Nutr_Val / 100.0) from mealfoods mf join nutr_def def join nut_data nd on mf.NDB_No = nd.NDB_No and def.Nutr_No = nd.Nutr_No and Tagname = $Tagname and meal_id >= $::FIRSTMEALts group by meal_id) select $width * (strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2)) - (select min(strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2))) from meals where meal_id >= $::FIRSTMEALts)) / (select max((strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2)) - (select min(strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2))) from meals where meal_id >= $::FIRSTMEALts))) from meals where meal_id >= $::FIRSTMEALts) as x, $height - (($height-2) * total(Nutr_Val) / (select max(y) from (select (strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2)) - (select min(strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2))) from meals where meal_id >= $::FIRSTMEALts)) / (select max((strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2)) - (select min(strftime('%J', substr(meal_id,1,4) || '-' || substr(meal_id,5,2) || '-' || substr(meal_id,7,2))) from meals where meal_id >= $::FIRSTMEALts))) from meals where meal_id >= $::FIRSTMEALts) as x, total(Nutr_Val) as y from meals where meal_id >= $::FIRSTMEALts group by x))) as y from meals where meal_id >= $::FIRSTMEALts group by x }] -width [expr {$::magnify * 2}] -fill "#FF7F00"}
nutsqlite-2.0.6/updateNUT.tcl-4210- }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4289-   set looong1 ""
nutsqlite-2.0.6/updateNUT.tcl:4290:   db eval {select Long_Desc as looong1, food_des.NDB_No as looong1ndb from food_des, mealfoods where food_des.NDB_No = mealfoods.NDB_No and meal_date = $::currentmeal / 100 and meal = $::currentmeal % 100 and mhectograms < 0.0 order by mhectograms asc limit 1} { }
nutsqlite-2.0.6/updateNUT.tcl-4291-   } else {
nutsqlite-2.0.6/updateNUT.tcl:4292:   db eval {select Long_Desc as looong1, food_des.NDB_No as looong1ndb from food_des, mealfoods where food_des.NDB_No = mealfoods.NDB_No and meal_date = $::currentmeal / 100 and meal = $::currentmeal % 100 and mhectograms > 0.0 order by mhectograms desc limit 1} { }
nutsqlite-2.0.6/updateNUT.tcl-4293-   }
nutsqlite-2.0.6/updateNUT.tcl:4294:  db eval {select Long_Desc as looong from food_des where NDB_No = $ndb} { }
nutsqlite-2.0.6/updateNUT.tcl-4295-  ${::rmMenu}.menu.foodPCF${seq} current 0
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4297-  if {$::GRAMSopt} {set ndbvar 0} else {set ndbvar 0.0}
nutsqlite-2.0.6/updateNUT.tcl:4298:  db eval {update mealfoods set mhectograms = 0.0 where NDB_No = $ndb and meal_date = $::currentmeal / 100 and meal = $::currentmeal % 100}
nutsqlite-2.0.6/updateNUT.tcl:4299:  db eval {update weight set Seq = origSeq, whectograms = orighectograms, Amount = origAmount where NDB_No = $ndb}
nutsqlite-2.0.6/updateNUT.tcl-4300-  setPCF $seq $ndb ::PCFchoice${ndb}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4302-  }
nutsqlite-2.0.6/updateNUT.tcl:4303: set upd {update mealfoods set mhectograms = mhectograms + (0.5 * $factor * ($dvvar - $rmvar)) where NDB_No = $ndb and meal_date = $::currentmeal / 100 and meal = $::currentmeal % 100}
nutsqlite-2.0.6/updateNUT.tcl-4304-
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4330-db eval {drop table if exists z_tcl_recipe_des; drop table if exists z_tcl_recipe_data; CREATE temp TABLE z_tcl_recipe_des (NDB_No int primary key, FdGrp_Cd int, Long_Desc text, Shrt_Desc text, Ref_desc text, Refuse integer, Pro_Factor real, Fat_Factor real, CHO_Factor real); CREATE temp TABLE z_tcl_recipe_data (NDB_No int, Nutr_No int, Nutr_Val real, primary key(NDB_No, Nutr_No));}
nutsqlite-2.0.6/updateNUT.tcl:4331:db eval {select count(*) as foodcount from mealfoods where meal_id = $::currentmeal} { }
nutsqlite-2.0.6/updateNUT.tcl-4332-if {$foodcount == 0} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4335- }
nutsqlite-2.0.6/updateNUT.tcl:4336:db eval {select total(Gm_Wgt) as "::RecipeWeight" from mealfoods where meal_id = $::currentmeal} { }
nutsqlite-2.0.6/updateNUT.tcl-4337-if {$::RecipeWeight <= 0.0} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4343-db eval {insert into z_tcl_recipe_data select $recipe_NDB_No, Nutr_No, Nutr_Val / (select meals_per_day from options) from rm_analysis}
nutsqlite-2.0.6/updateNUT.tcl:4344:db eval {select fdgrp_cd as recipe_fdgrp_cd, sum(gm_wgt) from mealfoods natural join food_des where meal_id = $::currentmeal group by recipe_fdgrp_cd limit 1} { }
nutsqlite-2.0.6/updateNUT.tcl-4345-db eval {insert into z_tcl_recipe_des values ($recipe_NDB_No, $recipe_fdgrp_cd, NULL, NULL, NULL, 0, (select nutr_val from z_tcl_recipe_data where nutr_no = 3000) / (select nutr_val from z_tcl_recipe_data where nutr_no = 203), (select nutr_val from z_tcl_recipe_data where nutr_no = 3001) / (select nutr_val from z_tcl_recipe_data where nutr_no = 204), (select nutr_val from z_tcl_recipe_data where nutr_no = 3002) / (select nutr_val from z_tcl_recipe_data where nutr_no = 205))}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4411-set varstarget ::${tag}ar
nutsqlite-2.0.6/updateNUT.tcl:4412:db eval {select dv_default as thedv from nutr_def where tagname = $tag} { }
nutsqlite-2.0.6/updateNUT.tcl-4413-upvar #0 $var thevar $varstarget thevarstarget
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4427-
nutsqlite-2.0.6/updateNUT.tcl:4428:db eval "select dv_default, Nutr_No from nutr_def where tagname = '$tag'" { }
nutsqlite-2.0.6/updateNUT.tcl:4429:db eval {select nutr_val as oldval from z_tcl_recipe_data where nutr_no = $Nutr_No} { }
nutsqlite-2.0.6/updateNUT.tcl:4430:db eval "update z_tcl_recipe_data set nutr_val = cast($$var as real) where nutr_no = $Nutr_No"
nutsqlite-2.0.6/updateNUT.tcl:4431:db eval {select nutr_val - $oldval as diff from z_tcl_recipe_data where nutr_no = $Nutr_No} { }
nutsqlite-2.0.6/updateNUT.tcl-4432-
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4435- trace remove variable $dvvar write [list RecipeModdv $tag]
nutsqlite-2.0.6/updateNUT.tcl:4436: db eval "select cast(round(100.0 * nutr_val / $dv_default) as int) as \"$dvvar\" from z_tcl_recipe_data where nutr_no = $Nutr_No" { }
nutsqlite-2.0.6/updateNUT.tcl-4437- trace add variable $dvvar write [list RecipeModdv $tag]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4856- uplevel #0 {
nutsqlite-2.0.6/updateNUT.tcl:4857:  db eval {update weight set Seq = "0" where NDB_No = $NDB_Novf and Msre_Desc = $Msre_Descvf}
nutsqlite-2.0.6/updateNUT.tcl-4858-  dropoutvf
nutsqlite-2.0.6/updateNUT.tcl:4859:  db eval {select NDB_No as NDB_Novf from food_des where Long_Desc = $ld limit 1} {
nutsqlite-2.0.6/updateNUT.tcl-4860-   db eval {insert into z_tcl_jobqueue values (null, 'view_foods', $NDB_Novf, null, null)}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4863-  set Long_Desc $ld
nutsqlite-2.0.6/updateNUT.tcl:4864:  db eval {select case when Refuse is not null then Refuse || "%" else Refuse end as Refusevf, setRefDesc(Ref_desc) from food_des where NDB_No = $NDB_Novf} { }
nutsqlite-2.0.6/updateNUT.tcl:4865:  db eval {select cast(round(Gm_Wgt) as int) as gramsvf, round(8.0 * Gm_Wgt / 28.35, 0) / 8.0 as ouncesvf, cast(round(Gm_Wgt * 0.01 * Nutr_Val) as int) as caloriesvf, round(8.0 * Amount, 0) / 8.0 as Amountvf, Msre_Desc as Msre_Descvf, 28.349523 as ounce2gram, case when Nutr_Val is null or Nutr_Val = 0.0 then 0.0 else 100.0/Nutr_Val end as cal2gram, origGm_Wgt/origAmount as Amount2gram from pref_Gm_Wgt join nut_data using (NDB_No) where NDB_No = $NDB_Novf and Nutr_No = 208} { }
nutsqlite-2.0.6/updateNUT.tcl:4866:  set servingsizes [db eval {select distinct Msre_Desc from weight where NDB_No = $NDB_Novf order by Seq limit 100 offset 1}]
nutsqlite-2.0.6/updateNUT.tcl-4867-  .nut.vf.cb configure -values $servingsizes
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4897-
nutsqlite-2.0.6/updateNUT.tcl:4898:db eval {delete from z_tcl_jobqueue where jobtype = 'defanal_am' and jobnum <= $jobnum; update options set defanal_am = $jobint}
nutsqlite-2.0.6/updateNUT.tcl-4899-
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4916-
nutsqlite-2.0.6/updateNUT.tcl:4917:db eval {select count(*) as jobcount from z_tcl_jobqueue where jobtype = 'mealfood_qty' and jobint = $ndb} { }
nutsqlite-2.0.6/updateNUT.tcl-4918-if {$jobcount == 0} {return}
nutsqlite-2.0.6/updateNUT.tcl-4919-
nutsqlite-2.0.6/updateNUT.tcl:4920:db eval {select jobreal, jobtext from z_tcl_jobqueue where jobnum = (select max(jobnum) from z_tcl_jobqueue where jobtype = 'mealfood_qty' and jobint = $ndb)} { }
nutsqlite-2.0.6/updateNUT.tcl-4921-
nutsqlite-2.0.6/updateNUT.tcl:4922:db eval {delete from z_tcl_jobqueue where jobtype = 'mealfood_qty' and jobint = $ndb and jobnum <= $jobnum}
nutsqlite-2.0.6/updateNUT.tcl-4923-
nutsqlite-2.0.6/updateNUT.tcl:4924:db eval {select long_desc from food_des where ndb_no = $ndb} { }
nutsqlite-2.0.6/updateNUT.tcl:4925:if {[catch { db eval {update mealfoods set Gm_Wgt = $jobreal where NDB_No = $ndb and meal_id = cast($jobtext as int)} }]} {
nutsqlite-2.0.6/updateNUT.tcl-4926- thread::send -async $::GUI_THREAD [list badPCF null null null 4]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-4939-
nutsqlite-2.0.6/updateNUT.tcl:4940:db eval {select count(*) as jobcount from z_tcl_jobqueue where jobtype = 'opt_change' and jobtext = $tag} { }
nutsqlite-2.0.6/updateNUT.tcl-4941-if {$jobcount == 0} {return}
nutsqlite-2.0.6/updateNUT.tcl-4942-
nutsqlite-2.0.6/updateNUT.tcl:4943:db eval {select jobnum, jobreal from z_tcl_jobqueue where jobnum = (select max(jobnum) from z_tcl_jobqueue where jobtype = 'opt_change' and jobtext = $tag)} { }
nutsqlite-2.0.6/updateNUT.tcl-4944-
nutsqlite-2.0.6/updateNUT.tcl:4945:db eval {delete from z_tcl_jobqueue where jobtype = 'opt_change' and jobtext = $tag and jobnum <= $jobnum}
nutsqlite-2.0.6/updateNUT.tcl-4946-
nutsqlite-2.0.6/updateNUT.tcl:4947:db eval {update nutr_def set nutopt = $jobreal where tagname = $tag}
nutsqlite-2.0.6/updateNUT.tcl-4948-
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5000-if {[string is integer -strict $parm]} {
nutsqlite-2.0.6/updateNUT.tcl:5001: db eval {select '::' || ndb_no as var, case when grams = 1 then cast(round(gm_wgt,0) as int) else round(8.0 * Gm_Wgt / 28.349523,0) / 8.0 end as val from mealfoods, options where meal_id = currentmeal and nutr_no is not null and ndb_no != $parm} {
nutsqlite-2.0.6/updateNUT.tcl-5002-  thread::send -async $::GUI_THREAD [list set $var $val]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5299- db eval {update options set currentmeal = $::currentmeal}
nutsqlite-2.0.6/updateNUT.tcl:5300: if {[db eval {select count(NDB_No) from mealfoods where meal_id = $::currentmeal}] > 0} {
nutsqlite-2.0.6/updateNUT.tcl:5301:  db eval {select mealfoods.NDB_No, Shrt_Desc from mealfoods, food_des where meal_id = $::currentmeal and food_des.NDB_No = mealfoods.NDB_No order by Shrt_Desc} {
nutsqlite-2.0.6/updateNUT.tcl-5302-   MealfoodWidget $Shrt_Desc $NDB_No
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5376- if {$selection != "No Auto Portion Control"} {
nutsqlite-2.0.6/updateNUT.tcl:5377:  db eval {select Tagname, Nutr_No from nutr_def where NutrDesc = $selection} { }
nutsqlite-2.0.6/updateNUT.tcl-5378-  set PCFfactor "\[No Data\]"
nutsqlite-2.0.6/updateNUT.tcl:5379:  db eval "select 1.0 / Nutr_Val / cast ($::meals_per_day as real) as PCFfactor from nutr_def left natural join nut_data where NDB_No = $ndb and Tagname = '$Tagname'" { }
nutsqlite-2.0.6/updateNUT.tcl-5380-  if {$PCFfactor == "\[No Data\]"} {
nutsqlite-2.0.6/updateNUT.tcl-5381-   set saveselection $selection
nutsqlite-2.0.6/updateNUT.tcl:5382:   db eval {select Long_Desc from food_des where NDB_No = $ndb} { }
nutsqlite-2.0.6/updateNUT.tcl-5383-   ${::rmMenu}.menu.foodPCF${seqno} current 0
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5387-   }
nutsqlite-2.0.6/updateNUT.tcl:5388:  set opt [db eval {select nutopt from nutr_def where NutrDesc = $selection}]
nutsqlite-2.0.6/updateNUT.tcl-5389-  if {$opt == -1} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5398-  set ::saveit $selection
nutsqlite-2.0.6/updateNUT.tcl:5399:  if {[catch { db eval {update currentmeal set NutrDesc = $selection where NDB_No = $ndb} }]} {
nutsqlite-2.0.6/updateNUT.tcl:5400:   db eval {update currentmeal set NutrDesc = null where NDB_no = $ndb}
nutsqlite-2.0.6/updateNUT.tcl-5401-   ${::rmMenu}.menu.foodPCF${seqno} current 0
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5432-  } else {
nutsqlite-2.0.6/updateNUT.tcl:5433:  db eval {update currentmeal set NutrDesc = null where NDB_No = $ndb}
nutsqlite-2.0.6/updateNUT.tcl-5434-  set oldtag [lindex $::MealfoodPCF $seqno]
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5528- TurnOnTheBubbleMachine
nutsqlite-2.0.6/updateNUT.tcl:5529: set addlist [db eval {select t.NDB_No, case when NutrDesc is null then 'No Auto Portion Control' else NutrDesc end as PCF, Shrt_Desc from theusual t, food_des f using (NDB_No) where meal_name = $mealname order by Shrt_Desc asc}]
nutsqlite-2.0.6/updateNUT.tcl-5530- if {[llength $addlist] > 0} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5544-  foreach {ndb pcf Shrt_Desc} $addlist {
nutsqlite-2.0.6/updateNUT.tcl:5545:   db eval {select Gm_Wgt from pref_Gm_Wgt where NDB_No = $ndb} {
nutsqlite-2.0.6/updateNUT.tcl-5546-    db eval {insert into currentmeal values ($ndb, $Gm_Wgt, $pcf)}
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5567-proc theusualSave {mealname} {
nutsqlite-2.0.6/updateNUT.tcl:5568: set ndblist [db eval {select NDB_No from mealfoods where meal_id = $::currentmeal}]
nutsqlite-2.0.6/updateNUT.tcl-5569- if {[llength $ndblist] > 0} {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5616-proc theusualDelete {mealname} {
nutsqlite-2.0.6/updateNUT.tcl:5617: db eval {delete from theusual where meal_name = $mealname}
nutsqlite-2.0.6/updateNUT.tcl-5618- }
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5646- set ndb [lindex $::MealfoodStatus $seq]
nutsqlite-2.0.6/updateNUT.tcl:5647: set qty [db eval {select Gm_Wgt from mealfoods where NDB_No = $ndb and meal_id = $::currentmeal}]
nutsqlite-2.0.6/updateNUT.tcl-5648- FoodChoicevf_alt $ndb $qty 1
##############################################
nutsqlite-2.0.6/updateNUT.tcl-5669-
nutsqlite-2.0.6/updateNUT.tcl:5670: db eval {select Tagname as tag, Units as un from nutr_def where NutrDesc = $nut} { }
nutsqlite-2.0.6/updateNUT.tcl-5671- .nut.po.pane.optframe.vite_l configure -text "$nut $un"
##############################################
nutsqlite-2.0.6/updateNUT.tcl-6003-if {$::THREADS} {
nutsqlite-2.0.6/updateNUT.tcl:6004: thread::send -async $::GUI_THREAD {wm deiconify . ; after cancel showTime ; destroy .loadframe ; db eval {select code from z_tcl_code where name = 'Start_NUT'} { } ; eval $code}
nutsqlite-2.0.6/updateNUT.tcl-6005- } else {
##############################################
nutsqlite-2.0.6/updateNUT.tcl-6131- set arglist [lrange $args 1 end]
nutsqlite-2.0.6/updateNUT.tcl:6132: set count [db eval {select count(*) from z_tcl_code where name = $pname}]
nutsqlite-2.0.6/updateNUT.tcl-6133- if {$count == 1} {
nutsqlite-2.0.6/updateNUT.tcl:6134:  set pcode [db eval {select code from z_tcl_code where name = $pname}]
nutsqlite-2.0.6/updateNUT.tcl-6135-  uplevel 1 {*}$pcode
##############################################
nutsqlite-2.0.6/updateNUT.tcl-6576-dbmem eval {select Tagname, Nutr_No, nutopt from lite.nutr_def} {
nutsqlite-2.0.6/updateNUT.tcl:6577: dbmem eval "insert or ignore into nut_data select NDB_No, $Nutr_No, $Tagname from lite.food_des where NDB_No >= 99000 and $Tagname is not null"
nutsqlite-2.0.6/updateNUT.tcl:6578: dbmem eval {update nutr_def set nutopt = $nutopt where Nutr_No = $Nutr_No}
nutsqlite-2.0.6/updateNUT.tcl-6579- }
##############################################
nutsqlite-2.0.6/bigNUT/lite2big.tcl-41-db eval {select Tagname, Nutr_No, nutopt from lite.nutr_def} {
nutsqlite-2.0.6/bigNUT/lite2big.tcl:42: db eval "insert or ignore into nut_data select NDB_No, $Nutr_No, $Tagname from lite.food_des where NDB_No >= 99000 and $Tagname is not null"
nutsqlite-2.0.6/bigNUT/lite2big.tcl:43: db eval {update nutr_def set nutopt = $nutopt where Nutr_No = $Nutr_No}
nutsqlite-2.0.6/bigNUT/lite2big.tcl-44- }