Thanks
I came across some strange behaviour with a new template (ignore the wonky indenting, I removed a lot of other if-thens):
Code:
program:
f = re($#chapters, '(.*)/.*', '\1');
s = re($#chapters, '.*/(.*)', '\1');
newpercent = round(multiply ((f / s), 100));
if newpercent < 99 then newpercent
else 98
fi
Basically:
Divide F by S. Multiply it by 100. Round it to the nearest digit. If the number less than 99, use the new number; otherwise set it to 98.
But on line 6 if I add a '#' to
if newpercent < #98 for the numeric comparison I get this error:
Code:
EXCEPTION: Formatter: Failed to scan program. Invalid input '#99 then newpercent \n\t\t\t\t\t\telse 98\n\t\t\t\t\tfi' near the end of the program
It works fine if I use it without the #. Did I make a syntax mistake?
EDIT: I misplaced a space. It should've been <# not < #.