Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.94 and 1.95

version 1.94, 2002/07/04 20:09:31 version 1.95, 2002/07/05 01:31:25
Line 106  my %courseopt; Line 106  my %courseopt;
 my %useropt;  my %useropt;
 my %parmhash;  my %parmhash;
   
   #
   # Some hashes for stats on timing and performance
   #
   
   my %starttimes;
   my %usedtimes;
   
 # Stuff that only the screen handler can know  # Stuff that only the screen handler can know
   
 my $includedir;  my $includedir;
Line 165  $cfn=''; Line 172  $cfn='';
   
 $usymb='';  $usymb='';
   
   # error messages
   
   $errormsg='';
   
 sub mask {  sub mask {
     my ($lower,$upper)=@_;      my ($lower,$upper)=@_;
   
Line 820  sub sett { Line 831  sub sett {
 }  }
   
 sub calc {  sub calc {
     %v=();      undef %v;
     &sett();      &sett();
     my $notfinished=1;      my $notfinished=1;
     my $depth=0;      my $depth=0;
       my $errormsg;
     while ($notfinished) {      while ($notfinished) {
  $notfinished=0;   $notfinished=0;
         foreach (keys(%t)) {          foreach (keys(%t)) {
             my $old=$v{$_};              my $old=$v{$_};
             $v{$_}=eval($t{$_});              $v{$_}=eval($t{$_});
     if ($@) {      if ($@) {
  %v=();   $v{$_}='"error"';
                 return $@;                  $errormsg.=$_.': '.$@."\n";
             }              }
     if ($v{$_} ne $old) { $notfinished=1; }      if ($v{$_} ne $old) { $notfinished=1; }
         }          }
         $depth++;          $depth++;
         if ($depth>100) {          if ($depth>100) {
     %v=();      undef %v;
             return 'Maximum calculation depth exceeded';              return 'Maximum calculation depth exceeded';
         }          }
     }      }
     return '';      return $errormsg;
 }  }
   
 sub templaterow {  sub templaterow {
Line 956  sub setrowlabels { Line 968  sub setrowlabels {
   
 sub calcsheet {  sub calcsheet {
     my $safeeval=shift;      my $safeeval=shift;
     $safeeval->reval('&calc();');      return $safeeval->reval('&calc();');
 }  }
   
 # ------------------------------------------------------------------ Get values  # ------------------------------------------------------------------ Get values
Line 1490  sub tmpread { Line 1502  sub tmpread {
         }          }
     } elsif ($nfield eq 'insertrow') {      } elsif ($nfield eq 'insertrow') {
         $countrows++;          $countrows++;
         my $newrow=substr('000000'.$i,-7);          my $newrow=substr('000000'.$countrows,-7);
         if ($nform eq 'top') {          if ($nform eq 'top') {
     $fo{'A'.$countrows}='--- '.$newrow;      $fo{'A'.$countrows}='--- '.$newrow;
         } else {          } else {

Removed from v.1.94  
changed lines
  Added in v.1.95


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>