From mboxrd@z Thu Jan 1 00:00:00 1970 From: andersvi@notam02.no Subject: column formulas: Row descriptor -1 used in line ### leads outside table Date: Thu, 04 Aug 2011 20:24:58 +0200 Message-ID: <87wrett4p1.fsf@notam02.no> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp2gN-0000Bo-7q for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 14:30:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qp2gM-0000Wb-5x for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 14:30:11 -0400 Received: from lo.gmane.org ([80.91.229.12]:57264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp2gL-0000Vx-O8 for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 14:30:10 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qp2gH-0003lE-S8 for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 20:30:05 +0200 Received: from ti0189a340-0777.bb.online.no ([85.165.211.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Aug 2011 20:30:05 +0200 Received: from andersvi by ti0189a340-0777.bb.online.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Aug 2011 20:30:05 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Anyone have suggestions about how i can have a column-formula refer to value in previous row, but ignore the row before the first line? Something like this: | 1 | 4 | | | 2 | 7 | | | 3 | 1 | | #+TBLFM: $2=random(10)::$3=(@-1$2)-$2 Evaluating this returns an error: "Row descriptor -1 used in line 547 leads outside table" I tried using a lisp-expression to dispatch on the row-number, but it doesnt seem to consider 'if as a special-form, trying to evaluate its last argument anyhow. | 1 | 2 | | | 2 | 6 | | | 3 | 2 | | #+TBLFM: $2=random(10)::$3='(if (< @# 3) 0 (- @-1$2 $2)) but get the same error. Thanks, -anders