Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.152 and 1.153

version 1.152, 2002/12/02 21:22:39 version 1.153, 2002/12/03 10:04:21
Line 1927  sub tmpwrite { Line 1927  sub tmpwrite {
     $fn=$tmpdir.$fn.'.tmp';      $fn=$tmpdir.$fn.'.tmp';
     my $fh;      my $fh;
     if ($fh=Apache::File->new('>'.$fn)) {      if ($fh=Apache::File->new('>'.$fn)) {
  print $fh join("\n",&getformulas($sheet));          my %f = &getformulas($sheet);
           while( my ($cell,$formula) = each(%f)) {
               print $fh &Apache::lonnet::escape($cell)."=".&Apache::lonnet::escape($formula)."\n";
           }
     }      }
 }  }
   
Line 1943  sub tmpread { Line 1946  sub tmpread {
     my %fo=();      my %fo=();
     my $countrows=0;      my $countrows=0;
     if ($fh=Apache::File->new($fn)) {      if ($fh=Apache::File->new($fn)) {
         my $name;          while (<$fh>) {
         while ($name=<$fh>) {      chomp;
     chomp($name);              my ($cell,$formula) = split(/=/);
             my $value=<$fh>;              $cell    = &Apache::lonnet::unescape($cell);
             chomp($value);              $formula = &Apache::lonnet::unescape($formula);
             $fo{$name}=$value;              $fo{$cell} = $formula;
             if ($name=~/^A(\d+)$/) {  
  if ($1>$countrows) {  
     $countrows=$1;  
                 }  
             }  
         }          }
     }      }
   #            chomp($value);
   #            $fo{$name}=$value;
   #            if ($name=~/^A(\d+)$/) {
   # if ($1>$countrows) {
   #    $countrows=$1;
   #                }
   #            }
   #        }
   #    }
     if ($nform eq 'changesheet') {      if ($nform eq 'changesheet') {
         $fo{'A'.$nfield}=(split(/__&&&\__/,$fo{'A'.$nfield}))[0];          $fo{'A'.$nfield}=(split(/__&&&\__/,$fo{'A'.$nfield}))[0];
         unless ($ENV{'form.sel_'.$nfield} eq 'Default') {          unless ($ENV{'form.sel_'.$nfield} eq 'Default') {
     $fo{'A'.$nfield}.='__&&&__'.$ENV{'form.sel_'.$nfield};      $fo{'A'.$nfield}.='__&&&__'.$ENV{'form.sel_'.$nfield};
         }          }
     } elsif ($nfield eq 'insertrow') {  #    } elsif ($nfield eq 'insertrow') {
         $countrows++;  #        $countrows++;
         my $newrow=substr('000000'.$countrows,-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 {
             $fo{'A'.$countrows}='~~~ '.$newrow;  #            $fo{'A'.$countrows}='~~~ '.$newrow;
         }  #        }
     } else {      } else {
        if ($nfield) { $fo{$nfield}=$nform; }         if ($nfield) { $fo{$nfield}=$nform; }
     }      }

Removed from v.1.152  
changed lines
  Added in v.1.153


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