<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Maxscript &amp;quot;Silent&amp;quot; error flagging in 2017 onwards in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7794625#M11069</link>
    <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a simple rollout to demonstrate an issue I am having with error handling between Max 2014 and Max 2017 onwards. Running the following code in 2014 and pressing the "B" button in the resulting rollout causes Maxscript to throw an "undefined" error. This, in turn, results in a pop-up message indicating as such, highlights the problematic line of code in the Maxscript Editor and reports out some additional information to the Listener. This is great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, running the same code in 2017 onwards results in no pop-up message, no problematic line highlights and a huge load of technical details reported out to the Listener.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trial code as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;rollout test "test"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;button b "B"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;on b pressed do xx.xx&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;createdialog test&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could somebody explain to me why 2017 onwards no longer highlights the problematic line in the Listener or throw a pop-up message indicating a script failure? I assume this is something to do with adapting the Editor to support Python, but the problem I have now is that it is not immediately obvious for the users of my scripts to know when an error has been thrown! Furthermore, it is not as straightforward to debug.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help on this would be most appreciated! Please note that I am not running in quiet mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;BR /&gt;Jack&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 11:30:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-21T11:30:18Z</dc:date>
    <item>
      <title>Maxscript "Silent" error flagging in 2017 onwards</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7794625#M11069</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a simple rollout to demonstrate an issue I am having with error handling between Max 2014 and Max 2017 onwards. Running the following code in 2014 and pressing the "B" button in the resulting rollout causes Maxscript to throw an "undefined" error. This, in turn, results in a pop-up message indicating as such, highlights the problematic line of code in the Maxscript Editor and reports out some additional information to the Listener. This is great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, running the same code in 2017 onwards results in no pop-up message, no problematic line highlights and a huge load of technical details reported out to the Listener.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trial code as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;rollout test "test"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;button b "B"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;on b pressed do xx.xx&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;createdialog test&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could somebody explain to me why 2017 onwards no longer highlights the problematic line in the Listener or throw a pop-up message indicating a script failure? I assume this is something to do with adapting the Editor to support Python, but the problem I have now is that it is not immediately obvious for the users of my scripts to know when an error has been thrown! Furthermore, it is not as straightforward to debug.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help on this would be most appreciated! Please note that I am not running in quiet mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;BR /&gt;Jack&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 11:30:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7794625#M11069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-21T11:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript "Silent" error flagging in 2017 onwards</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7794841#M11070</link>
      <description>&lt;P&gt;Hi Jack, I believe you are correct that this behavior changed when the MAXScript editor started supporting Python.&amp;nbsp; I'll mention a couple of things that might help you out (maybe).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, the exception that gets printed out in the listener gives you a lot of information, including the line number that produced the error.&amp;nbsp; From your example I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;-- MAXScript Rollout Handler Exception:
-- Unknown property: "xx" in undefined
-- MAXScript callstack:
--	thread data: threadID:29240
--	------------------------------------------------------
--	[stack level: 0]
--	In b.pressed(); filename: ; position: 41; line: 4
--	member of: Rollout:test
--		Locals:
--			xx: undefined
--		Externals:
--			test: Rollout:test
--			owner: Rollout:test
--	------------------------------------------------------
--	[stack level: 1]
--	called from top-level&lt;/PRE&gt;
&lt;P&gt;It tells me that xx is undefined, and it's property .xx is unknown, as well as the line number and any local variables that were defined.&amp;nbsp; This is quite helpful information, though I admit not quite as helpful as having the actual line number highlighted in the editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, if you need to communicate failure / exceptions to your users, you can use a try/catch block.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;rollout test "test"
(
button b "B"
on b pressed do 
	try
		xx.xx
	catch
		messageBox "An error occurred calling xx.xx"
)
createdialog test&lt;/PRE&gt;
&lt;P&gt;This will pop up an error for your users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Drew&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 13:00:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7794841#M11070</guid>
      <dc:creator>drew_avis</dc:creator>
      <dc:date>2018-02-21T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript "Silent" error flagging in 2017 onwards</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7798359#M11071</link>
      <description>&lt;P&gt;Thanks Drew, but the example I gave is very basic, whereas a lot of my scripts are a lot more complex and would be difficult to litter with try-catches. Additionally, would try-catches not result in a performance hit?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I take it that there will be no further looking into this to return the behaviour to what it was?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 08:50:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7798359#M11071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T08:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript "Silent" error flagging in 2017 onwards</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7799742#M11072</link>
      <description>&lt;P&gt;Hi Jack, so I just had a conversation with a developer about this, and it looks like it's not actually related to the Python integration, but is a separate bug.&amp;nbsp; We've entered a defect and it will be looked at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Line highlighting on error should still work in some cases - if you just create a function 'fn test2 = xxx.xxx', evaluate it, and then call it from the listener, the line is highlighted in the editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Drew&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 14:34:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7799742#M11072</guid>
      <dc:creator>drew_avis</dc:creator>
      <dc:date>2018-02-22T14:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript "Silent" error flagging in 2017 onwards</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7799814#M11073</link>
      <description>&lt;P&gt;Ok great - thanks for following this up, Drew - I look forward to the fix! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 14:48:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-quot-silent-quot-error-flagging-in-2017-onwards/m-p/7799814#M11073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T14:48:33Z</dc:date>
    </item>
  </channel>
</rss>

