<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/14916.aspx</link><pubDate>Sat, 25 Nov 2006 19:10:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14916</guid><dc:creator>TTS</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14916.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14916</wfw:commentRss><description>Of course I want loop through the chidren, but that's not the explanation.&lt;br /&gt;I found that for...in works fine with objects made by script itself such as&lt;br /&gt;obj={"a" : "Athens" , "b" : "Belgrade", "c" : "Cairo"}&lt;br /&gt;but not with&lt;br /&gt;XDocument, XDocument.DOM.firstChild, eventObj and so on.&lt;br /&gt;It's a pity.&lt;br /&gt;</description></item><item><title>Re: for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/14915.aspx</link><pubDate>Fri, 24 Nov 2006 19:20:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14915</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14915.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14915</wfw:commentRss><description>Hi,&lt;br /&gt;XDocument.DOM in &lt;b&gt;var dest=findPropertyByValue("something", XDocument.DOM);&lt;/b&gt; is just one node, its not an enumerator to loop through it.&lt;br /&gt;Probably you want to loop through the children of "XDocument.DOM".&lt;br /&gt;</description></item><item><title>Re: for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/14914.aspx</link><pubDate>Thu, 23 Nov 2006 14:33:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14914</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14914.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14914</wfw:commentRss><description>Hi TTS,&lt;br /&gt;&lt;br /&gt;I am sorry. In C#, we will used to 'foreach' loop but in JScript your syntax is correct. Can you check once 'fObj' object is get the value or not. And one more is what about 'needle' value?&lt;br /&gt;&lt;br /&gt;You can get the more information on 'for' and 'for in' loops&lt;br /&lt;a target="_blank" href=http://msdn2.microsoft.com/en-gb/library/y3wd7kkh.aspx&gt;http://msdn2.microsoft.com/en-gb/library/y3wd7kkh.aspx&lt;/a&gt;</description></item><item><title>Re: for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/14913.aspx</link><pubDate>Thu, 23 Nov 2006 12:02:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14913</guid><dc:creator>TTS</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14913.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14913</wfw:commentRss><description>Thanks, but it's js, not c# script&lt;br /&gt;Did I posted this in wrong forum?</description></item><item><title>Re: for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/14912.aspx</link><pubDate>Thu, 23 Nov 2006 05:38:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14912</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14912.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14912</wfw:commentRss><description>Hi TTS welcome to the Forums,&lt;br /&gt;&lt;br /&gt;We don't have syntax like "for(i in fObj)". We need to use "foreach(i in fObj)" otherwise you can use directly for loop.&lt;br /&gt;If you want to get more information on loops go through this link,&lt;br /&lt;a target="_blank" href=http://www.samspublishing.com/articles/article.asp?p=101656&amp;seqNum=6&amp;rl=1&gt;http://www.samspublishing.com/articles/article.asp?p=101656&amp;seqNum=6&amp;rl=1&lt;/a&gt;</description></item><item><title>for(i in XDocument) - not works</title><link>https://www.infopathdev.com:443/forums/thread/12988.aspx</link><pubDate>Wed, 22 Nov 2006 23:42:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12988</guid><dc:creator>TTS</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12988.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12988</wfw:commentRss><description>How to find object with property having specified value?&lt;br /&gt;This code doesn't work&lt;br /&gt;&lt;pre&gt;function findPropertyByValue(needle, fObj)&lt;br /&gt;{&lt;br /&gt;	var i;&lt;br /&gt;	for(i in fObj){&lt;br /&gt;		if(fObj&lt;i&gt;==needle) return i;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	var success;&lt;br /&gt;	if(fObj.firstChild!=null){&lt;br /&gt;		success=findPropertyByValue(needle, fObj.firstChild);&lt;br /&gt;		if(success!=null) return "-&amp;gt;"+success;&lt;br /&gt;	}&lt;br /&gt;	while(fObj.nextSibling!=null){&lt;br /&gt;		success=findPropertyByValue(needle, fObj=fObj.nextSibling);&lt;br /&gt;		if(success!=null) return "-&amp;gt;"+success;&lt;br /&gt;	}&lt;br /&gt;	return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function CTRL21_7::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;	var dest=findPropertyByValue("something", XDocument.DOM);&lt;br /&gt;	if(dest!=null) 	XDocument.UI.Alert(dest);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There is error on row "for(i in fObj){" (object doesn't support command)&lt;br /&gt;What's wrong? How to do it?</description></item></channel></rss>