emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Large numbers of named variables in Babel


From: Brett Witty
Subject: [O] Large numbers of named variables in Babel
Date: Thu, 7 Aug 2014 00:27:09 +1000

Hi,

I'm trying to write my RPG adventures in org-mode and would like to bring character sheets into that fold. Is there a way in Babel to have a vast number of named variables that I can feed into source blocks? Are macros the way to achieve this?

As an example, I'd like something like a big (hidden) table:
#+NAME: stats
| STR | 13 |
| DEX | 12 |
| CON | 11 |

and then later I can use that like:
#+NAME: AC
#+begin_src python :var dex=table[DEX] :var armour=table[ARMOUR]
return dex + armour
#+end_src

I know I can make explicit cell references, but it'd be neat to just use keys for values.

Cheers,

BrettW

reply via email to

[Prev in Thread] Current Thread [Next in Thread]