From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephan Schmitt Subject: Re: Spreadsheet bug? Date: Fri, 24 Jul 2009 11:20:58 +0200 Message-ID: <4A697CFA.6050001@cs.tu-berlin.de> References: <20090723160554.5AA76324F7@mailhost.cs.tu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUGyT-00074i-2V for emacs-orgmode@gnu.org; Fri, 24 Jul 2009 05:21:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUGyO-00072v-3r for emacs-orgmode@gnu.org; Fri, 24 Jul 2009 05:21:56 -0400 Received: from [199.232.76.173] (port=57363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUGyN-00072o-QS for emacs-orgmode@gnu.org; Fri, 24 Jul 2009 05:21:51 -0400 Received: from mail.cs.tu-berlin.de ([130.149.17.13]:59214) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MUGyN-0003ZE-Fh for emacs-orgmode@gnu.org; Fri, 24 Jul 2009 05:21:51 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost-12225.cs.tu-berlin.de (Postfix) with ESMTP id 7210430A9E for ; Fri, 24 Jul 2009 11:21:49 +0200 (MEST) In-Reply-To: <20090723160554.5AA76324F7@mailhost.cs.tu-berlin.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Andreas Burtzlaff wrote: > On Thu, 23 Jul 2009 02:29:30 +0200 meingbg wrote: >> > | a | b | c | >> > |---+----+---| >> > | a | 2 | 2 | >> > | b | 3 | 7 | >> > | c | -3 | 4 | >> > | d | 5 | 9 | >> > #+TBLFM: $3=$2+@-1::@2$3=$2 > > If @2$3 is manually set to 2 in the table, then the formulas produce > the expected outcome. So, the problem seems to be the order of > execution. If column c is cleared and the formulas are executed, @2$3 > is read to be 0 for the summation and is set to 2 only afterwards. > Swapping the order in the TBLFM line doesn't help. > > Is the order something like field formulas after column formulas? > Any chance to influence that? Evaluating the field formulas before the column formulas is in general a bad idea. Results of the field formulas will always be overwritten by the column formulas (if there is a conflict). Here you need to evaluate the spreadsheet twice to yield the intended result (I get a 5 in field @2$3). From info:org:Updating the table: > `C-u C-u C-c *' > `C-u C-u C-c C-c' > Iterate the table by recomputing it until no further changes occur. > This may be necessary if some computed fields use the value of > other fields that are computed later in the calculation sequence. hth, Stephan