<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Transformation Scripts]]></title><description><![CDATA[<p dir="auto">Why does this fail in transformation script:</p>
<p dir="auto">if ($1 == null)<br />
    return 0;<br />
else<br />
    return ($1 * 2);</p>
]]></description><link>https://forum.netxms.org/topic/903/transformation-scripts</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:26:02 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/903.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Apr 2010 15:54:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transformation Scripts on Wed, 28 Apr 2010 14:22:28 GMT]]></title><description><![CDATA[<p dir="auto">Test button will work only for nodes (not templates) - because test is done by sending script to server and running it in context of specific node.<br />
For testing scripts where $node variable is not used you could also use nxscript command line tool. If using nxscript, first command line argument will be passed to script as $1, second as $2, and so on.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4167</link><guid isPermaLink="true">https://forum.netxms.org/post/4167</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 28 Apr 2010 14:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to Transformation Scripts on Wed, 28 Apr 2010 13:51:17 GMT]]></title><description><![CDATA[<p dir="auto">I pasted the following in the transformation script window:<br />
sub main()<br />
{<br />
  if ($1 == 0)<br />
     return 1;<br />
  else<br />
     return ($1 * 2);<br />
}<br />
When I click the test button I get the following: request failed 'Incompatible operation'</p>
<p dir="auto">Can I not use the test button?</p>
]]></description><link>https://forum.netxms.org/post/4166</link><guid isPermaLink="true">https://forum.netxms.org/post/4166</guid><dc:creator><![CDATA[Lyn007]]></dc:creator><pubDate>Wed, 28 Apr 2010 13:51:17 GMT</pubDate></item><item><title><![CDATA[Reply to Transformation Scripts on Tue, 27 Apr 2010 20:41:35 GMT]]></title><description><![CDATA[<p dir="auto">What exact error you got? Is it entire script or just a fragment? If it is entire script, you should write it as</p>
<p dir="auto">sub main()<br />
{<br />
  if ($1 == null)<br />
     return 0;<br />
  else<br />
     return ($1 * 2);<br />
}</p>
<p dir="auto">or rewrite as</p>
<p dir="auto">($1 == null) ? 0 : $1 * 2</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/4160</link><guid isPermaLink="true">https://forum.netxms.org/post/4160</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 27 Apr 2010 20:41:35 GMT</pubDate></item></channel></rss>