Thanks Eric,

I'll minimize the need of this by using "#+babel: var=something" for
variables that are common to many blocks.

The tip with the table is a good one also.

--
Darlan Cavalcante

At Tue, 21 Jun 2011 13:17:17 -0700,
Eric Schulte wrote:
> 
> Unfortunately org-mode properties only allow a single entry for any
> given key, so you can only specify one variable using properties.
> 
> However the following workaround does exist.
> 
> *** alternative
>     :PROPERTIES:
>     :var:      vars=variables
>     :END:
> 
> #+tblname: variables
> | var1 | 1 |
> | var2 | 2 |
> 
> #+begin_src python
>   print vars[0][1]
>   print vars[1][1]
> #+end_src
> 
> Best -- Eric
> 
> Darlan Cavalcante Moreira <darc...@gmail.com> writes:
> 
> > I'm using org-babel to automate a few tasks and I'd like to define a few
> > variables that are common to several code blocks as sub-tree properties.
> >
> > It works when I have only one variable, where I can use
> > * Heading
> >   :PROPERTY:
> >   :var: variable1="value1"
> >   :END:
> >   #+begin_src python :results output
> >     print variable1
> >   #+end_src
> >
> >   #+results:
> >   : value1
> >
> > Is it possible to set multiples variables in this way?
> > I tried things like
> > :PROPERTY:
> > :var: variable1="value1" variable2="value2"
> > :END:
> >
> > :PROPERTY:
> > :var: variable1="value1",variable2="value2"
> > :END:
> >
> > :PROPERTY:
> > :variable1: "value1"
> > :variable2: "value2"
> > :END:
> > but none of them worked.
> >
> >
> > --
> > Darlan Cavalcante
> >
> 
> -- 
> Eric Schulte
> http://cs.unm.edu/~eschulte/

Reply via email to