<?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: Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/15166.aspx</link><pubDate>Thu, 08 Mar 2007 17:10:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15166</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15166.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15166</wfw:commentRss><description>Good catch. Thanks.&lt;br /&gt;&lt;br /&gt;JLProgrammer, be careful to not mix syntax from multiple programming languages. Looks like you had a combination of JScript, VBScript, and C# in there!&lt;br /&gt;&lt;br /&gt;Make sure to scan the rest of your code for any more such mixings.&lt;br /&gt;&lt;br /&gt;Good luck!</description></item><item><title>Re: Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/15165.aspx</link><pubDate>Thu, 08 Mar 2007 06:45:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15165</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15165.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15165</wfw:commentRss><description>HI,&lt;br /&gt;&lt;br /&gt;you have to change your "string xPath" to "var xPath".&lt;br /&gt;Don't forget you use scripting.&lt;br /&gt;</description></item><item><title>Re: Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/15164.aspx</link><pubDate>Wed, 07 Mar 2007 21:25:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15164</guid><dc:creator>JLProgrammer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15164.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15164</wfw:commentRss><description>Thanks everyone!  I took all of your advice and made the changes you suggested.  However I'm still getting the same error message.  &lt;br /&gt;"InfoPath cannot open the selected form because of an error in the form's code.&lt;br /&gt;The following error occurred:&lt;br /&gt;&lt;br /&gt;Expected ';'&lt;br /&gt;File:script.js&lt;br /&gt;Line:24&lt;br /&gt;string txtPath;"&lt;br /&gt;&lt;br /&gt;Line 24 is this line in the code I posted:string txtPath;&lt;br /&gt;</description></item><item><title>Re: Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/15163.aspx</link><pubDate>Wed, 07 Mar 2007 19:03:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15163</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15163.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15163</wfw:commentRss><description>Also, you want to change:&lt;br /&gt;&lt;br /&gt;XDocument.SaveAs(txtpath &amp; GMSRef &amp; txtName);&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;XDocument.SaveAs(txtpath + GMSRef + txtName);&lt;br /&gt;&lt;br /&gt;The &amp; character is used in VBScript, the + character in JScript.&lt;br /&gt;</description></item><item><title>Re: Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/15162.aspx</link><pubDate>Wed, 07 Mar 2007 19:03:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15162</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15162.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15162</wfw:commentRss><description>Try changing:&lt;br /&gt;&lt;br /&gt;txtPath = "Z:\My Documents\InfoPath Forms\";&lt;br /&gt;&lt;br /&gt;to &lt;br /&gt;&lt;br /&gt;txtPath = "Z:\\My Documents\\InfoPath Forms\\";&lt;br /&gt;&lt;br /&gt;The backslash character is an "escape" character, and the \" combination means that you want a literal quote in your string, rather than closing the quote of the string. The \\ combination means that you wan the \ character.&lt;br /&gt;</description></item><item><title>Expected ';' Error</title><link>https://www.infopathdev.com:443/forums/thread/13079.aspx</link><pubDate>Wed, 07 Mar 2007 18:57:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13079</guid><dc:creator>JLProgrammer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13079.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13079</wfw:commentRss><description>I am receiving the following error:&lt;br /&gt;&lt;pre&gt;"InfoPath cannot open the selected form because of an error in the form's code.&lt;br /&gt;The following error occurred:&lt;br /&gt;&lt;br /&gt;Expected ';'&lt;br /&gt;File:script.js&lt;br /&gt;Line:24&lt;br /&gt;string txtPath;"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Any idea why this would be happening? &lt;br /&gt;&lt;br /&gt;Here is the entire code:&lt;br /&gt;&lt;pre&gt;function CTRL2_5::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;string txtPath;&lt;br /&gt;string txtName;&lt;br /&gt;string GMSRef;&lt;br /&gt;&lt;br /&gt;GMSRef = XDocument.DOM.selectSingleNode("my:myFields/my:field2").text;&lt;br /&gt;txtPath = "Z:\My Documents\InfoPath Forms\";&lt;br /&gt;txtName = ".xml";&lt;br /&gt;&lt;br /&gt;XDocument.SaveAs(txtpath &amp; GMSRef &amp; txtName);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;thisXDocument.Application.Close(true);&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I had received help in converting from VBScript to JScript in this thread: &lt;a href='http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4558' target='_blank' title='http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4558'&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4558&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4558&lt;/a&gt;&lt;/a&gt;</description></item></channel></rss>