Previous | Next | (P-PDF) JavaScript
Topic: Re: Adding a number pulled from a string to another number
Conf: (P-PDF) JavaScript, Msg: 104478
From: kjfish
Date: 1/23/2004 07:09 AM
Thanks for the replies. Here is what I have been trying to do. I have
some bookmarks that have numbers in the front such as,
8 Deep In the Mountains
I am getting the number at the beginning of a bookmark as a
variable and adding 1 to it. I kept poking around in all the
JavaScript references and finally found parseInt() and that works.
So here is what I came up with.
var bm2 = bookmarkRoot.children[1].name
var theMark = bookmarkRoot.children[1]
var thePageNum = bm2.substr(0, 1)
thePageNum = parseInt(thePageNum)
theMark.setAction("this.pageNum = " + (thePageNum + 1) + ";")
Now all I need to do is figure out how to delete the number from
the front of the bookmark.