Thank you Eric for explaining that about the global variables and the
fact that fields have to all be lower case.

Your code does kind of work, but its adding as text, not as math, e.g.
if I start with versecount of 0, then press the ">" button, the
versecount (and thus the window.fetStartIndex) becomes 015, then
01515.

Is there a way to indicate that it should all be in math?

Thanks for your help,
-Dave

On Mar 8, 6:32 pm, Eric Shulman <[email protected]> wrote:
> > <script>
> > var CountValue = store.getValue(tiddler, "VerseCount");
> > </script>
>
> * This actually creates another global variable, window.CountValue,
> which isn't really necessary since store.getValue() can be called
> later on, in response to pressing the "<" or ">" buttons (see
> suggested code changes below).
>
> * Custom field names must be *all lower case* (due a known limitation
> in the core).  Thus, you have to use "versecount" or "verse_count" or
> just "vc", instead of "VerseCount".
>
> So, eliminate the global entirely, and then write the 'button' code to
> look something like this:
>
> createTiddlyButton(context.place,"<",null,
>    function(e) {
>       var c=store.getValue(tiddler,"vc")-window.fetItemsPerPage;
>       store.setValue(tiddler.title,"versecount",c);
>       window.fetStartIndex = c;
>       story.refreshTiddler(context.viewerTiddler.title,null,true);
>    });
> createTiddlyButton(context.place,">",null,
>    function(e) {
>       var c=store.getValue(tiddler,"vc")+window.fetItemsPerPage;
>       store.setValue(tiddler.title,"versecount",c);
>       window.fetStartIndex = c;
>       story.refreshTiddler(context.viewerTiddler.title,null,true);
>    });
>
> (note: untested code)
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to