From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: what's wrong with this sbe? Date: Mon, 05 Mar 2012 07:34:49 -0700 Message-ID: <87r4x7ax0x.fsf@gmx.com> References: <8762ejdxe3.fsf@ed.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4ZpS-0001wZ-QB for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:28:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4Zp4-0002xu-2s for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:28:02 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:45893) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S4Zp3-0002xP-RT for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:27:38 -0500 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: Myles English Cc: emacs-orgmode Mode --=-=-= Content-Type: text/plain Myles English writes: > Hi, > > Please could tell me where I am going wrong with this? I just can't get > the source block to put a result in the table. > > #+name: workingDays > #+BEGIN_SRC emacs-lisp :var hms="0" > (require 'org-timer) > (/ (org-timer-hms-to-secs hms) (* 60 60 8)) > #+END_SRC > > #+call: workingDays(hms="236:30:00") > > #+RESULTS: workingDays(hms="236:30:00") > : 29 > > | Days | H:M:S | > |--------+-----------| > | #ERROR | 236:30:00 | > #+TBLFM: @2$1='(sbe "workingDays" (hms @2$2)) > Hi Miles, To force the value of "236:30:00" to be interpreted as a string (rather than have sbe try to convert it to a number prefix the reference with a "$" character). However even doing this your example exposed a bug in this sbe functionality to which I've just pushed up a fix. With the latest version of Org-mode the attached works as expected. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=sbe-example.org #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC Note the variable reference is prefixed with a "$" to ensure that it is interpreted as a string. See the `sbe' documentation for full `sbe' usage information. | Days | H:M:S | |------+-----------| | 29 | 236:30:00 | #+TBLFM: @2$1='(sbe workingDays (hms $@2$2)) --=-=-= Content-Type: text/plain Cheers, > > > Thanks, > > Myles > -- Eric Schulte http://cs.unm.edu/~eschulte/ --=-=-=--