Dear list, I am working on a dynamic report in Org mode, where I use source blocks in various languages to process data. Several blocks produce text or tables that become part of the PDF on export. The final chapter should state whether all checks passed, or whether one or more failed (it is not necessary to know which step failed). In a single language environment, I would use a variable (called e.g. nrChecksFailed) that would be incremented for each failing check. In a single language Org document this could probably be done with a :session, but given that I mix Awk, Bash, Emacs lisp and R that doesn't look like the way to go. Do Org documents/source blocks have some concept of a (global) variable that I can pass to my SRC blocks and increment inside them? E.g. after somehow initialising nrChecksFailed = 0, I would like to do: #+header :var nFailed=nrChecksFailed :var someData=someData #+begin_src R :results raw do_some_check_here_on_someData if (check_results_OK) { cat("check A passed\n") } else { cat("check A *failed*\n") nFailed <- nFailed + 1 } #+end_src So that in my conclusion chapter I can do for example: #+header: :var nFailed=nrChecksFailed #+begin_src bash :results raw if [[ nFailed -eq 0 ]]; then echo "All checks passed else echo "One or more checks *failed!*" fi #+end_src Best regards, Lennart. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* L.C. Karssen The Netherlands lennart@karssen.org http://blog.karssen.org GPG key ID: A88F554A -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-