> script to get remote field value:
> <script>
> var wt=store.getValue("weight","wt")
> var ht=parseInt(store.getValue("height","height"))
> var bmi = Math.round(wt/(ht*ht)*703*10)/10
>
> return wt
> return ht
> return bmi
> </script>

The "return" statement ends the processing of the script and returns
*text* to be rendered into the tiddler output.  However, if the return
value is *numeric*, then it is used as a 'success/fail' result code
(non-zero=success) for use with "onclick" scripts, and is not
displayed as output.

Note: The parseInt(...) isn't needed.  If the field value (which is
stored as *text*) is composed of only numeric characters -- plus
possible decimal point, leading +/- sign, and trailing "e-
notation" (e.g., "-123.45e+5") -- then, when used in a numeric
expression, javascript automatically converts it to a value for
calculation purposes.

Note: all javascript statements should always end with ";" to ensure
unambiguous interpretation of any statements that follow.

Thus:

<script>
var wt=store.getValue("weight","wt");
var ht=store.getValue("height","height");
var bmi = Math.round(wt/(ht*ht)*703*10)/10;
return "weight is: "+wt+"\nheight is: "+ht+"\nbmi is "+bmi;
</script>

enjoy,
-e

-- 
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