[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet Spreadsheet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 28 May 2003 17:38:57 -0000


matthew		Wed May 28 13:38:57 2003 EDT

  Modified files:              
    /loncom/interface/spreadsheet	Spreadsheet.pm 
  Log:
  Modification to &expandsum:  If we cannot locate the parameter, return '""'
  instead of a string describing the parameter we could not find.  This
  keeps a lack of a parameter from blowing up a cell computation.
  
  
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.9 loncom/interface/spreadsheet/Spreadsheet.pm:1.10
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.9	Wed May 28 11:20:40 2003
+++ loncom/interface/spreadsheet/Spreadsheet.pm	Wed May 28 13:38:57 2003
@@ -1,5 +1,5 @@
 #
-# $Id: Spreadsheet.pm,v 1.9 2003/05/28 15:20:40 matthew Exp $
+# $Id: Spreadsheet.pm,v 1.10 2003/05/28 17:38:57 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -816,7 +816,7 @@
             push @matches,$parameter if ($parameter =~ /$expression/);
         }
         if (scalar(@matches) == 0) {
-            $returnvalue = 'unmatched parameter: '.$parameter;
+            $returnvalue = '""';#'"unmatched parameter: '.$parameter.'"';
         } elsif (scalar(@matches) == 1) {
             # why do we not do this lookup here, instead of delaying it?
             $returnvalue = '$c{\''.$matches[0].'\'}';
@@ -832,7 +832,7 @@
         } else {
             # There was a negative number of matches, which indicates 
             # something is wrong with reality.  Better warn the user.
-            $returnvalue = 'bizzare parameter: '.$parameter;
+            $returnvalue = '"bizzare parameter: '.$parameter.'"';
         }
         return $returnvalue;
     }