I've tried to pare things down a bit, and am trying to put values into
fields to figure out why this isn't working:
<script>
window.checkboxHandler = function()
{
var upd = config.options.chkokinl1;
var upd1 = (upd=="true") ? 1 : 0;
var upd2 = Math.round((upd1*2)-1);
tids=store.getTaggedTiddlers("OKinL1");
store.setValue("OKinL1","tidslist",tids); <-- trying to see "tids" by
putting it in a field, (1)
for (var i=0; i<tids.length; i++)
{
var t=tids[i].title;
var wtDx=store.getValue(t,"wt"); <-- will probably have to have "if
empty, set as 0"
var newWt=Math.round(wtDx+upd2);
store.setValue(t,"wt",newWt); <-- the main problem (2)
store.setValue("OKinL1",i,wtDx); <-- my error message "invalid filed name
0" (3)
}
}
</script>
(1) ... but arrays don't go nicely into fields. I found a reference to
using "tobracketedlist" to get that to work but can't find any details
(2) ... when I look at the field in the appropriate tiddlers it says "NaN"
instead of a revised value. Also some tiddlers would have a non-existant
field, so maybe you can't add 1 or -1 to an empty field
(3) ... I know I can make a field called "0" (zero), but I guess that's the
text version and I need to convert the variable "i" into string format. Is
there an opposite of "Math.round" that turns a number into a string?
Also, let me know if this should actually be a new thread, because you
really answered my original question and its working as you said it should
thanks,
Dave
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.