Question: Due to that composite column recursion glitch, I did this to avoid using variables in the template:
Code:
program:
if
$#fanficcat
&&
$#currentlyreading
&&
$#kobobookmark
then
strcat(format_number(subtract((re($#kobobookmark, '.*\/file(\d+).*', '\1')), 1), '{0:,d}'), '/',$$#chaptercount)
fi
Now that it's fixed in source, would changing them back to variables make the template run any more efficiently?
Code:
program:
input = $#kobobookmark;
a = re(input, '.*\/file(\d+).*', '\1');
if
$#fanficcat
&&
$#currentlyreading
&&
$#kobobookmark
then
strcat(format_number(subtract(a, 1), '{0:,d}'), '/',$$#chaptercount)
fi
Context: This template shows how many chapters of a fanfic I've read compared to how many exist. It checks that the book is a fanfic that's currently being read, then it extracts the number and since I pause at chapter beginnings it subtracts one:
ideally, it'd also check that $#kobobookmark starts with
OEBPS/file but I've not quite figured out how to get
it working yet.