From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry =?utf-8?b?UGVsbMOp?= Subject: Re: Computations on properties Date: Thu, 10 Oct 2013 06:39:22 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU9uZ-0007i3-Nj for emacs-orgmode@gnu.org; Thu, 10 Oct 2013 02:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU9uS-0006hQ-DP for emacs-orgmode@gnu.org; Thu, 10 Oct 2013 02:39:51 -0400 Received: from plane.gmane.org ([80.91.229.3]:54871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU9uS-0006hF-6Y for emacs-orgmode@gnu.org; Thu, 10 Oct 2013 02:39:44 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VU9uQ-0000eC-LT for emacs-orgmode@gnu.org; Thu, 10 Oct 2013 08:39:42 +0200 Received: from modem.soliavos.fr ([109.190.80.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Oct 2013 08:39:42 +0200 Received: from thierry.pelle by modem.soliavos.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Oct 2013 08:39:42 +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 After some tests : ==> the idea of Michael > -------------------------------- > * Mean Calculation > :PROPERTIES: > :VAL1: 5 > :VAL2: 10 > :COEF: 10 > :END: > > Mean Calculation = call_mean() =5.454545454545454= > > * code :noexport: > #+NAME: mean > #+HEADER: :var val1='nil > #+HEADER: :var val2='nil > #+HEADER: :var coef='nil > #+BEGIN_SRC emacs-lisp :exports none > (setq > val1 (string-to-number (org-entry-get > org-babel-current-src-block-location "VAL1" t)) > val2 (string-to-number (org-entry-get > org-babel-current-src-block-location "VAL2" t)) > coef (string-to-number (org-entry-get > org-babel-current-src-block-location "COEF" t))) > (/ (+ (* val1 coef) val2) (+ coef 1.0)) > #+END_SRC > -------------------------------- give an error ( "Symbol's value as variable is void: org-babel-current-src-block-location") ==> After some tests, it works in changing the "setq" part as val1 (or val1 (string-to-number (org-entry-get org-babel-current-src-block-location "VAL1" t) )) I can't figure out why... ==> I will try with python... Thanks