View Single Post
Old 01-14-2022, 08:58 AM   #797
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,091
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
OK, I think I understand what is happening to you now. Since you are still trying to configure an action without having run the chain, the value of pagenum is an empty string (chain variables are only assigned at runtime, even without the runtime option ticked).

So, at this point in time, the value of pagenum (empty string) cannot be used in mathematical operations, and the template evaluator will return an error and you will not be able to save it. To remedy this:

Code:
program:
   pagenum = ifempty(globals(pagenum), 1)
   pagenum = globals(pagenum=1)
This will give the evaluator a valid default, and the template should be accepted. You can use any numerical value, except ZERO, as you are using it as the denominator.

Last edited by capink; 01-14-2022 at 10:36 AM. Reason: include chaley's solution
capink is offline   Reply With Quote