Index: trunk/ippTasks/register.pro
===================================================================
--- trunk/ippTasks/register.pro	(revision 30438)
+++ trunk/ippTasks/register.pro	(revision 30458)
@@ -105,6 +105,6 @@
 
 macro register.add.date
-  if ($0 != 2) 
-    echo "USAGE: register.add.date (YYYY-MM-DD)"
+  if ($0 != 4) 
+    echo "USAGE: register.add.date (YYYY-MM-DD) (DBNAME) (VALID_BURNTOOL)"
     break
   end
@@ -112,9 +112,10 @@
    book newpage regDates $1
    book setword regDates $1 nsState NEW
-   book setword regDates $1 dbname $DB:0 
-end
-
-
-$valid_burntool_value = 14
+   book setword regDates $1 dbname $2
+   book setword regDates $1 valid_burntool $3
+end
+
+
+# $valid_burntool_value = 14
 $sunrise = 17:30:00
 $sunset  = 03:30:00
@@ -567,4 +568,6 @@
      else 
        book getpage regDates $reg_datePAGE -var today
+       book getword regDates $reg_datePAGE dbname -var dbname
+       book getword regDates $reg_datePAGE valid_burntool -var valid_burntool
        $reg_datePAGE ++
        if ($reg_datePAGE >= $Npages) set reg_datePAGE = 0
@@ -577,14 +580,18 @@
     $dateobs_begin = $today\T$sunset
     $dateobs_end   = $today\T$sunrise
-    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool_value
-    if ($DB:n == 0)
-      option DEFAULT
-    else
-      # save the DB name for the exit tasks
-      option $DB:$regPendingBurntoolImfile_DB
-      $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
-      $regPendingBurntoolImfile_DB ++
-      if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
-    end
+    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool
+    $run = $run -dbname $dbname
+#     if ($DB:n == 0)
+#       option DEFAULT
+#     else
+#       # save the DB name for the exit tasks
+#       option $DB:$regPendingBurntoolImfile_DB
+#       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
+#       if ("$dbname" != "$DB:$regPendingBurntoolImfile_DB")
+#         break
+#       end
+#       $regPendingBurntoolImfile_DB ++
+#       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
+#     end
 
 #    echo $run
@@ -697,4 +704,5 @@
     book setword regDates $today nsState NEW
     book setword regDates $today dbname $DB:0
+    book setword regDates $today valid_burntool 14
 
     command true
