<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Jscript Addition Operator</title><link>https://www.infopathdev.com:443/forums/thread/43642.aspx</link><pubDate>Tue, 30 Jun 2009 23:17:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43642</guid><dc:creator>phamj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43642.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=43642</wfw:commentRss><description>&lt;p&gt;I tried it again this morning it returned the right result from what I did previously. Strange. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for the help.&lt;/p&gt;
&lt;p&gt;However that was just my quick fixed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;But what I really want is a convert&amp;nbsp;a string to a number&amp;nbsp;as&amp;nbsp;for&amp;nbsp;doc_version,&amp;nbsp;the value is actually taken from a database which returns a number as a string. &lt;/p&gt;
&lt;p&gt;I cannot use parseInt for this as it is a string and therefore&amp;nbsp;returns 1.#NAN&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Jscript Addition Operator</title><link>https://www.infopathdev.com:443/forums/thread/43605.aspx</link><pubDate>Tue, 30 Jun 2009 08:38:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43605</guid><dc:creator>Rajitha</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43605.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=43605</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the value of ‘request_doc_version.text&amp;#39; here? Can you check once?&lt;/p&gt;
&lt;p&gt;parseInt method works like this.&lt;/p&gt;
&lt;p&gt;parseInt(&amp;quot;abc&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Returns NaN.&lt;/p&gt;
&lt;p&gt;parseInt(&amp;quot;12abc&amp;quot;)&amp;nbsp;&amp;nbsp; // Returns 12.&lt;/p&gt;
&lt;p&gt;parseInt(&amp;quot;12&amp;quot;) // Returns 12.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;</description></item><item><title>Re: Jscript Addition Operator</title><link>https://www.infopathdev.com:443/forums/thread/43603.aspx</link><pubDate>Tue, 30 Jun 2009 07:08:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43603</guid><dc:creator>phamj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43603.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=43603</wfw:commentRss><description>&lt;p&gt;Oh sorry it should have been request_doc_version.text initially - pasted the wrong code&lt;/p&gt;
&lt;p&gt;&amp;nbsp;However none of them work. For example... &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(request_doc_version.text + 1); // returns 21&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(parseInt(request_doc_version.text) + 1); // returns 1.#QNAN&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(parseFloat(request_doc_version.text) + 1); // returns 1.#QNAN&lt;/p&gt;
&lt;p&gt;Apparently you can do Convert.ToInt32 method in jscript... but I am not familar with this &lt;a href="http://msdn.microsoft.com/en-us/library/system.convert.toint32(VS.71).aspx"&gt;http://msdn.microsoft.com/en-us/library/system.convert.toint32(VS.71).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Any other ideas? Thanks&lt;/p&gt;</description></item><item><title>Re: Jscript Addition Operator</title><link>https://www.infopathdev.com:443/forums/thread/43602.aspx</link><pubDate>Tue, 30 Jun 2009 06:30:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43602</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43602.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=43602</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Could you explain what the getInfo() function is doing?&lt;/p&gt;&lt;p&gt;&amp;nbsp;To convert a string to an int, you can use parseInt(var), but this line looks problematic:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;request_doc_version = doc_version + 1;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;because request_doc_version is an XML node, not a string variable. Try:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;request_doc_version.&lt;b&gt;text &lt;/b&gt;= parseInt(doc_version) + 1; &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Jscript Addition Operator</title><link>https://www.infopathdev.com:443/forums/thread/43599.aspx</link><pubDate>Tue, 30 Jun 2009 04:38:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43599</guid><dc:creator>phamj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43599.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=43599</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to do something very simple - adding two numbers. However instead of &amp;quot;adding&amp;quot; it&amp;#39;s concatenated instead. &lt;/p&gt;
&lt;p&gt;I have set my field to Whole Number (integer) and in my jscript code basically just add 1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;function check_version() { &lt;/p&gt;
&lt;p&gt;&amp;nbsp;var request_doc_version = XDocument.DOM.selectSingleNode(&amp;quot;my:document/my:metadata/my:doc_version&amp;quot;);&amp;nbsp;&lt;br /&gt;&amp;nbsp;var request_doc_create_version = XDocument.DOM.selectSingleNode(&amp;quot;my:document/my:metadata/my:doc_create_version&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var doc_version = getInfo( &amp;#39;version&amp;#39; );&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;if ( request_doc_create_version.text == &amp;quot;Yes&amp;quot;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;request_doc_version = doc_version + 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;request_doc_version.text = doc_version;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;return;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t quite understand.&lt;/p&gt;
&lt;p&gt;Is there a way to conver the string to integer or number?&lt;/p&gt;</description></item></channel></rss>