Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.93 and 1.96

version 1.93, 2002/07/04 17:51:32 version 1.96, 2002/07/05 21:44:50
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;
   my %numbertimes;
   
 # Stuff that only the screen handler can know  # Stuff that only the screen handler can know
   
 my $includedir;  my $includedir;
Line 122  sub initsheet { Line 130  sub initsheet {
     $safeeval->permit("sort");      $safeeval->permit("sort");
     $safeeval->deny(":base_io");      $safeeval->deny(":base_io");
     $safehole->wrap(\&Apache::lonnet::EXT,$safeeval,'&EXT');      $safehole->wrap(\&Apache::lonnet::EXT,$safeeval,'&EXT');
       $safeeval->share('$@');
     my $code=<<'ENDDEFS';      my $code=<<'ENDDEFS';
 # ---------------------------------------------------- Inside of the safe space  # ---------------------------------------------------- Inside of the safe space
   
Line 165  $cfn=''; Line 174  $cfn='';
   
 $usymb='';  $usymb='';
   
   # error messages
   
   $errormsg='';
   
 sub mask {  sub mask {
     my ($lower,$upper)=@_;      my ($lower,$upper)=@_;
   
Line 820  sub sett { Line 833  sub sett {
 }  }
   
 sub calc {  sub calc {
     %v=();      undef %v;
     &sett();      &sett();
     my $notfinished=1;      my $notfinished=1;
     my $depth=0;      my $depth=0;
Line 828  sub calc { Line 841  sub calc {
  $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=();   undef %v;
                 return $@;                  return $_.': '.$@;
             }              }
     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';
         }          }
     }      }
Line 956  sub setrowlabels { Line 969  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 1503  sub tmpread {
         }          }
     } elsif ($nfield eq 'insertrow') {      } elsif ($nfield eq 'insertrow') {
         $countrows++;          $countrows++;
           my $newrow=substr('000000'.$countrows,-7);
         if ($nform eq 'top') {          if ($nform eq 'top') {
     $fo{'A'.$countrows}='AAAAA_'.$countrows;      $fo{'A'.$countrows}='--- '.$newrow;
         } else {          } else {
             $fo{'A'.$countrows}='zzzzz_'.$countrows;              $fo{'A'.$countrows}='~~~ '.$newrow;
         }          }
     } else {      } else {
        if ($nfield) { $fo{$nfield}=$nform; }         if ($nfield) { $fo{$nfield}=$nform; }

Removed from v.1.93  
changed lines
  Added in v.1.96


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