Index: /branches/sc_branches/ippMonitorLap/def/lapStacks.d
===================================================================
--- /branches/sc_branches/ippMonitorLap/def/lapStacks.d	(revision 31789)
+++ /branches/sc_branches/ippMonitorLap/def/lapStacks.d	(revision 31790)
@@ -7,5 +7,5 @@
 
 ARGS  ARG1	stackRun.stack_id=$stackRun1.stack_id
-ARGS  ARG2	stackRun.stack_id=$(stackRun2.stack_id)
+ARGS  ARG2	stackRun.stack_id=$stackRun2.stack_id
 
 #     field                   size  format  name         show    link to                  extras
Index: /branches/sc_branches/ippMonitorLap/scripts/generate
===================================================================
--- /branches/sc_branches/ippMonitorLap/scripts/generate	(revision 31789)
+++ /branches/sc_branches/ippMonitorLap/scripts/generate	(revision 31790)
@@ -61,7 +61,16 @@
             if ($field =~ m|\S+\s+as\s+\S+|) {
                 ($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
+		#print STDERR "Case 1\n";
+            } elsif ($field =~ m|\S+\s+AS\s+\S+|) {
+		#print STDERR "field=$field\n";
+		$fieldreal = $field;
+		$fieldreal =~ s/\s+AS.*$//;
+                #($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
+		#print STDERR "Case 2\n";
             } else {
                 $fieldreal = $field;
+		#print STDERR "Case 3\n";
             }
+	    #print STDERR "field=[$field]\tfieldreal=[$fieldreal]\n";
 
             if ($VERBOSE) { printf "%-20s %-20s %-20s %-20s %-20s %-20s\n", $field, $name, $format, $show, $link, $extras; }
@@ -527,5 +536,7 @@
     @extfields = split (/,/, $extras);
     for ($i = 0; $i < @extfields; $i++) {
+	# print STDERR $extfields[$i],"\n";
         ($label, $value, $outline) = &parse_label ($extfields[$i]);
+	# print STDERR "[",$label,"]","[",$value,"]","[",$outline,"\n";
         print FILE "  \$link = \$link . \"&$outline\";\n";
     }
@@ -540,12 +551,21 @@
     ($word, $value) = split (" ", $_[0]);
 
+    # print STDERR "#############################\n";
+    # foreach my $key ( keys %linkarg ) {
+    # 	print STDERR "key: $key, value: $linkarg{$key}\n";
+    # }
+
     # print STDERR "0: $_[0], $word, $value\n";
+    # print STDERR "[$linkarg{$word}]\n";
 
     if ($linkarg{$word}) {
+	# print STDERR "Case 1\n";
         $linkarg{$word} = "$linkarg{$word},$value";
     } else {
+	# print STDERR "Case 2\n";
         $linkarg{$word} = $value;
     }
     # print STDERR "linkarg($word) : $linkarg{$word}\n";
+    # print STDERR "#############################\n";
 }
 
@@ -563,8 +583,20 @@
     $value = "";
 
+    # print STDERR "### parse_label ###\n";
+    # for ($i = 0; $i < @field; $i++) {
+    # 	print STDERR "field[$i]=$field[$i]\n";
+    # }
+    # for ($i = 0; $i < @fieldreal; $i++) {
+    # 	print STDERR "fieldreal[$i]=$fieldreal[$i]\n";
+    # }
+    # for ($i = 0; $i < @count; $i++) {
+    # 	print STDERR "count[$i]=$count[$i]\n";
+    # }
+
     # search for embedded table fields and replace with row[N]
     if ($VERBOSE) { print STDERR "string: $string\n"; }
     if ($string =~ m|\S+=\S+|) {
         ($label, $value) = $string =~ m|(\S+)=(\S+)|;
+	# print STDERR "value=$value\n";
         if ($value =~ m|^\$|) {
           MATCH_LABEL:
@@ -572,11 +604,11 @@
                 if ($field[$i] eq "*") { next; }
                 while ($value =~ m|\$$fieldreal[$i]|) {
-                    print "field: $fieldreal[$i]\n";
+                    # print STDERR "field: $fieldreal[$i]\n";
                     # ($part1, $name, $part2) = $value =~ m|\$($fieldreal[$i])\@(\S+)|;
                     ($part1, $name, $part2) = $value =~ m|(\S*)\$($fieldreal[$i])(\S*)|;
-                    print "name: $name\n";
-                    print "part1: $part1\n";
-                    print "part2: $part2\n";
-                    print "value: $value\n";
+                    # print STDERR "name: $name\n";
+                    # print STDERR "part1: $part1\n";
+                    # print STDERR "part2: $part2\n";
+                    # print STDERR "value: $value\n";
 
                     $Nrow = $count[$i];
@@ -587,5 +619,5 @@
                     #     $value = "\$row[$Nrow]";
                     # }
-                    # print "outval: $value\n";
+                    # print STDERR  "outval: $value\n";
                     # last MATCH_LABEL;
                 }
