View Single Post
Old 09-29-2022, 08:42 PM   #921
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,207
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Question: Is it possible to set the default of a runtime variable to the value of a specified column of the selected book?

Code:
program:

	currentchap = globals(Current_Chapter=1);
 	strcat('OEBPS/file', format_number(add(currentchap, 1), '04d'), '.xhtml#kobo.1.1')
For example, can I set Current_Chapter to default to the value of #chaptercount rather than 1?
For runtime variables, the default value is irrelevant whenever you run the chain. It will always be assigned to the value you specified at the pop up variable dialog. Even if you press OK without specifying a value, the value will be an interpreted as an empty string.

The only time the default value has any effect; is at config time to act as place holder for numerical values, to prevent template errors, as explained in the notes section of this post.

Edit: Also the runtime variable cannot be per book, but per chain.

Last edited by capink; 09-29-2022 at 08:59 PM.
capink is offline   Reply With Quote