Current Chapter Number
July 20, 2016 12:00 AM
Is there a way to query the current chapter number of a title other than using a variable?
Discussion (8)
I am aware of CurrentChapterName. I was trying to get the number of the chapter in sequence.
You can rename the chapters to "1", "2", "3" and so on and then the CurrentChapterName becomes CurrentChapterNumber... so to say :)
I don't think so, but there is a built-in variable for this, so you don't need to create and set one of your own. It's called CurrentChapterName. So for instance, an On Page Show action could Change Contents of a text block to the value [CurrentChapterName].
"I was trying to get the number of the chapter in sequence." Can you elaborate?
If you're into substrings and stuff, you could just use JS to grab the table of contents object and parse it. Then figure out which chapter in the array of all chapters (that you get from TOC) is the "current chapter name". I did TOC parsing for my Lectora search snippet, if you need an idea on how to do that: https://github.com/SergeySnegirev/lectora-search-engine
You can rename the chapters to “1”, “2”, “3” and so on and then the CurrentChapterName becomes CurrentChapterNumber… so to say
I still want to use the real name to display using CurrentChapterName. Maybe it is possible to get a substring of the CurrentChapterName.
Introduction_1
Engine Components_2
Need to look into this.
undefined
Can you elaborate?
Just how the chapters are displayed with in the flow in the tree.
Introduction would be 1
Engine Components would be 2
and so on.
Back in Authorware days, there were variables like ParentNum and ChildNum (or something similar as it has been few years since I used the product), etc. so you knew what was the parent and child.

Discussions have been disabled for this post