Index: trunk/ippMonitor/scripts/generate
===================================================================
--- trunk/ippMonitor/scripts/generate	(revision 15969)
+++ trunk/ippMonitor/scripts/generate	(revision 18143)
@@ -267,5 +267,10 @@
 	$value = $field[$i];
 	if ($value eq "*") { next; }
-	print FILE "\$WHERE = check_restrict ('$value', \$WHERE);\n";
+	if ($format[$i] eq "%s") {
+	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'string');\n";
+	} else {
+	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'min');\n";
+	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'max');\n";
+	}
     }
     print FILE "\$WHERE = check_ordering (\$WHERE);\n";
@@ -278,6 +283,43 @@
 	$value = $field[$i];
 	if ($value eq "*") { next; }
-	print FILE "\$buttonLink = button_restrict ('$value', \$buttonLink);\n";
-    }
+	if ($format[$i] eq "%s") {
+	    print FILE "\$buttonLink = button_restrict_string ('$value', \$buttonLink);\n";
+	} else {
+	    print FILE "\$buttonLink = button_restrict_min ('$value', \$buttonLink);\n";
+	    print FILE "\$buttonLink = button_restrict_max ('$value', \$buttonLink);\n";
+	}
+    }
+}
+
+# there are two query rows: the first is populated for both strings
+# and numbers, the second only for numbers
+sub write_table_query {
+    my ($i);
+
+    print FILE "echo \"<tr>\\n\";\n";
+    for ($i = 0; $i < @field; $i++) {
+	if ($show[$i] eq "none")  { next; }
+	if ($field[$i] eq "*")  { 
+	    # * fields create an empty cell 
+	    print FILE "echo \"<td> &nbsp; </td>\\n\";\n";
+	} else {
+	    if ($format[$i] eq "%s") {
+		print FILE "write_query_row ('$field[$i]', $width[$i], 'string');\n";
+	    } else {
+		print FILE "write_query_row ('$field[$i]', $width[$i], 'min');\n";
+	    }
+	}
+    }
+    print FILE "echo \"</tr> <tr>\\n\";\n";
+    for ($i = 0; $i < @field; $i++) {
+	if ($show[$i] eq "none")  { next; }
+	if (($field[$i] eq "*") || ($format[$i] eq "%s")) { 
+	    # * fields create an empty cell 
+	    print FILE "echo \"<td class=\\\"list\\\"> &nbsp; </td>\\n\";\n";
+	} else {
+	    print FILE "write_query_row ('$field[$i]', $width[$i], 'max');\n";
+	}
+    }
+    print FILE "echo \"</tr>\\n\";\n";
 }
 
@@ -342,17 +384,4 @@
 }
 
-sub write_table_query {
-    my ($i);
-    for ($i = 0; $i < @field; $i++) {
-	if ($show[$i] eq "none")  { next; }
-	if ($field[$i] eq "*")  { 
-	    # * fields create an empty cell 
-	    print FILE "echo \"<td> &nbsp; </td>\\n\";\n";
-	} else {
-	    print FILE "write_query_row ('$field[$i]', $width[$i]);\n";
-	}
-    }
-}
-
 sub define_fields_string {
     my (@array) = @_;
