<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - return undefined error]]></title>
		<link>http://railsforum.com/viewtopic.php?id=46552</link>
		<description><![CDATA[The most recent posts in return undefined error.]]></description>
		<lastBuildDate>Sat, 22 Oct 2011 11:40:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[return undefined error]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=145895#p145895</link>
			<description><![CDATA[<p>Hi - I have been testing some code for using the results with Google maps.&nbsp; The calculations are fine, but when the value is returned I get an undefined error.&nbsp; Any help would be appreciated.</p><p>Also, my editor is highlighting the following line with an error:<br />&nbsp; &nbsp; &nbsp; &nbsp;yres = (ycalc[yi] / ydiv);</p><p>Txs.&nbsp; &nbsp;Ronnie</p><br /><p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;<br />&nbsp; &nbsp; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>&quot;&gt;</p><p>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</p><p>&lt;head&gt;<br />&nbsp; &lt;title&gt;&lt;/title&gt;</p><br /><p>&lt;script type=&quot;text/javascript&quot;&gt;</p><p>&nbsp; var lat = 28.48805;<br />&nbsp; &nbsp; var llong = -82.545564;<br />&nbsp; &nbsp; var longDir = &quot;W&quot;;<br />&nbsp; &nbsp; var latDir = &quot;N&quot;;<br />&nbsp; &nbsp; var stra = &quot;&quot;;<br />&nbsp; &nbsp; var ychr = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;<br />&nbsp; &nbsp; var ynum = &quot;0123456789&quot;;<br />&nbsp; &nbsp; var yqth, yi, yk, ydiv, yres, ylp, y;<br />&nbsp; &nbsp; var y&nbsp; &nbsp; &nbsp;= 0;<br />&nbsp; &nbsp; var ycalc = new Array(0,0,0);<br />&nbsp; &nbsp; var yn&nbsp; &nbsp; = new Array(0,0,0,0,0,0,0);</p><p>&nbsp; &nbsp; stra += Math.round(lat * 10000) / 10000 + &quot; &quot; + latDir;<br />&nbsp; &nbsp; stra += &quot;, &quot;;<br />&nbsp; &nbsp; stra += Math.round(llong * 10000) / 10000 + &quot; &quot; + longDir;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ycalc[1] = llong + 180;<br />&nbsp; &nbsp; ycalc[2] = lat +&nbsp; 90;</p><p>&nbsp; &nbsp; for (yi = 1; yi &lt; 3; ++yi) {<br />&nbsp; &nbsp; &nbsp; &nbsp; for (yk = 1; yk &lt; 4; ++yk) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yk != 3) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yi == 1) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yk == 1) ydiv = 20;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yk == 2) ydiv = 2;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yi == 2) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yk == 1) ydiv = 10;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yk == 2) ydiv = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yres = (ycalc[yi] / ydiv);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ycalc[yi] = yres;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ycalc[yi]&gt;0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ylp = Math.floor(yres)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ylp = Math.ceil(yres);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ycalc[yi] = (ycalc[yi] - ylp) * ydiv;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (yi == 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ydiv = 12<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ydiv = 24;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yres = ycalc[yi] * ydiv;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ycalc[yi] = yres;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ycalc[yi]&gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ylp = Math.floor(yres)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ylp = Math.ceil(yres);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++y;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yn[y] = ylp;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; yqth = ychr.charAt(yn[1]) + ychr.charAt(yn[4]) + ynum.charAt(yn[2]);<br />&nbsp; &nbsp; yqth += ynum.charAt(yn[5]) + ychr.charAt(yn[3])+ ychr.charAt(yn[6]);<br />&nbsp; &nbsp; stra += &quot;, &quot; + yqth;<br />&nbsp; &nbsp; alert(stra);<br />&nbsp; &nbsp; return stra;<br />&nbsp; &nbsp; }<br />&lt;/script&gt;</p><p>&lt;/head&gt;</p><p>&lt;body&gt;</p><p>&lt;script type=&quot;text/javascript&quot;&gt;<br />&nbsp; &nbsp; var stra;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; test();<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; alert(stra);&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&lt;/script&gt;</p><p>&lt;/body&gt;</p><p>&lt;/html&gt; </p><p>__________________</p><p><a href="http://www.aesolarsystems.com/solar-panel-installation/doncaster-solar-panels-installers.html">solar installers doncaster</a><br /><a href="http://www.geoffbrandrealestate.com.au/mermaid-beach-property-management/">Mermaid Beach Property Managers</a></p>]]></description>
			<author><![CDATA[dummy@example.com (rahikumar)]]></author>
			<pubDate>Sat, 22 Oct 2011 11:40:31 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=145895#p145895</guid>
		</item>
	</channel>
</rss>
