From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Newell Subject: Re: Distinguish between blank and zero in org-mode spreadsheet Date: Tue, 11 Dec 2012 04:50:50 +0000 (UTC) Message-ID: References: <87r4mxv7l8.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiHrt-0004V9-CN for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 23:54:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiHrs-0007JY-2P for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 23:54:57 -0500 Received: from plane.gmane.org ([80.91.229.3]:56704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiHrr-0007JM-S8 for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 23:54:55 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TiHs1-0006uF-0v for emacs-orgmode@gnu.org; Tue, 11 Dec 2012 05:55:05 +0100 Received: from udp259009uds.hawaiiantel.net ([72.253.220.237]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Dec 2012 05:55:05 +0100 Received: from bobnewell by udp259009uds.hawaiiantel.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Dec 2012 05:55:05 +0100 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 I'm making it work, and using "L" rather than "S" turns out to be better, as in this revision of my example above: $9 = '(if (eq "$2" "") "" (* @2$8 $1));L But when I want different actions when there is an explicit number (including 0) vs. a blank cell, and if my action is at all complex, I end up with one monster like this: $3 = '(if (eq "$2" "") "" (if (< $2 @2$8) 0 (calcFunc-max 0 (calcFunc-ilog (/ $2 @2$8) 2))));L and it just seems that "there oughta be a way" to do this with calc and outside of elisp. I've tried all sorts of calc things without success to date. (This gets even worse when you work with ranges and need to do operations on the cells in those ranges.) I guess the upside is that with elisp you can eventually do almost anything that comes to mind, if you have enough patience.