[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Computations on properties
From: |
Thierry Pellé |
Subject: |
Re: [O] Computations on properties |
Date: |
Thu, 10 Oct 2013 06:39:22 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.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