I'm trying to transform the data from one table to another however I can't do it with built in functions so I have to use org-sbe to call some elisp:
#+tblname: clues | 02a8 | 0050 | 5012 | 2225 | 9555 | #+name: hex-word-to-bitmap #+begin_src emacs-lisp :var hex='02a8 (let ((res "") (number (string-to-number (prin1-to-string hex) 16))) (while (not (= number 0)) (setq res (concat (if (= 1 (logand number 1)) "1" "0") res)) (setq number (lsh number -1))) (if (string= res "") (setq res "0")) res)) #+end_src
The end result is not every number is converted when I apply the following table formula:
#+tblname: hex-to-bitmap | #ERROR | 1010000 | 101000000010010 | 10001000100101 | 1011110 | #+TBLFM: @<$<..@>$>='(org-sbe hex-word-to-bitmap (hex (identity remote(clues,@@#$$#))))
I thought identity should pass along the data unmolested but I don't seem to be able to get it to work. What am I doing wrong?