<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Need Javascript help for metadata point"]]></title>
		<link>http://mango.serotoninsoftware.com/forum/posts/list/3.page</link>
		<description><![CDATA[Latest messages posted in the topic "Need Javascript help for metadata point"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Need Javascript help for metadata point</title>
				<description><![CDATA[ I have 1-wire DS2450 A/D numerical data available I would like to convert to binary for simple on/off notification. Can someone please give me some direction as to the proper script to do this for a metadata point?

For example:

If the input is <= 0.5 then output 0 binary
If the input is >0.5 then output 1 binary

I am not familiar with JS programming and syntax (last programming I did was 30 years ago in FORTRAN) and have tried several things with no success. 

Thanks in advance!]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/list/290.page#1306</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/list/290.page#1306</link>
				<pubDate><![CDATA[Tue, 2 Feb 2010 09:32:14]]> GMT</pubDate>
				<author><![CDATA[ mhradom]]></author>
			</item>
			<item>
				<title>Re:Need Javascript help for metadata point</title>
				<description><![CDATA[ Hi Mike,

Try this (assuming &quot;x&quot; is the var name you give the point):

<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
if &#40;x.value &lt= 0.5&#41;
    return false;
return true;
</pre>
		</div>

... and set the meta point to be a binary. That ought to do it.]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/list/290.page#1311</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/list/290.page#1311</link>
				<pubDate><![CDATA[Tue, 2 Feb 2010 20:20:20]]> GMT</pubDate>
				<author><![CDATA[ mlohbihler]]></author>
			</item>
			<item>
				<title>Re:Need Javascript help for metadata point</title>
				<description><![CDATA[ Thanks Matthew. 

I actually got it figured out by myself like this:

<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">if &#40;p33.value&lt;=0.5&#41;
   {
return false 
   }
else 
   {
return true
    }</pre>
		</div>

I see so many different styles of coding for JavaScript on the web, I don't know what is actually required and what is personal preference. Do you know a good resource to learn more?

Anyway if works perfectly. I continue to be amazed at the flexibility and capability of Mango! Now I just need to get my 1-wire network more stable.]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/list/290.page#1315</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/list/290.page#1315</link>
				<pubDate><![CDATA[Wed, 3 Feb 2010 12:19:19]]> GMT</pubDate>
				<author><![CDATA[ mhradom]]></author>
			</item>
			<item>
				<title>Re:Need Javascript help for metadata point</title>
				<description><![CDATA[ Thanks. Re Javascript, just ask Google. There's a ton of resources around.]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/list/290.page#1316</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/list/290.page#1316</link>
				<pubDate><![CDATA[Wed, 3 Feb 2010 12:26:24]]> GMT</pubDate>
				<author><![CDATA[ mlohbihler]]></author>
			</item>
	</channel>
</rss>