<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.netxms.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phil</id>
	<title>NetXMS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.netxms.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phil"/>
	<link rel="alternate" type="text/html" href="https://wiki.netxms.org/wiki/Special:Contributions/Phil"/>
	<updated>2026-04-20T11:26:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.4</generator>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Class_Reference&amp;diff=1780</id>
		<title>NXSL Class Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Class_Reference&amp;diff=1780"/>
		<updated>2020-10-05T14:21:35Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_class_reference NXSL Class Reference]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===NetObj and its sub-classes===&lt;br /&gt;
[[NXSL:NetObj|NetObj]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Cluster|Cluster]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Interface|Interface]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Node|Node]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Zone|Zone]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SNMP related classes===&lt;br /&gt;
[[NXSL:SNMP_Transport|SNMP_Transport]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:SNMP_VarBind|SNMP_VarBind]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other classes===&lt;br /&gt;
[[NXSL:Alarm|Alarm]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Component|Component]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:DCI|DCI]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Event|Event]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:FILE|FILE]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:GeoLocation|GeoLocation]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:InetAddress|InetAddress]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:NewNode|NewNode]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Situation|Situation]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Table|Table]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:TableColumn|TableColumn]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:TIME|TIME]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:UserDBObject|UserDBObject]]&lt;br /&gt;
&lt;br /&gt;
-[[NXSL:User|User]]&lt;br /&gt;
&lt;br /&gt;
-[[NXSL:UserGroup|UserGroup]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Function_Reference&amp;diff=1779</id>
		<title>NXSL Function Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Function_Reference&amp;diff=1779"/>
		<updated>2020-10-05T14:20:59Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_function_reference NXSL Function Reference] for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Function tables =&lt;br /&gt;
{| {border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;2&amp;quot; style=&amp;quot;border:\#c9c9c9 1px solid; margin: 1em 1em 1em 0; border-collapse: collapse;&amp;quot;}&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Generic&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Math&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;String-related&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Data Collection&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Object search&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Object management&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:CountScheduledTasksByKey|CountScheduledTasksByKey]]||[[NXSL:abs|abs]]||[[NXSL:ArrayToString|ArrayToString]]||[[NXSL:CreateDCI|CreateDCI]]||[[NXSL:FindNodeObject|FindNodeObject]]||[[NXSL:BindObject|BindObject]]||[[NXSL:AddrInRange|AddrInRange]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:classof|classof]]||[[NXSL:ceil|ceil]]||[[NXSL:chr|chr]]||[[NXSL:FindAllDCIs|FindAllDCIs]]||[[NXSL:FindObject|FindObject]]||[[NXSL:CreateContainer|CreateContainer]]||[[NXSL:AddrInSubnet|AddrInSubnet]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:d2x|d2x]]||[[NXSL:exp|exp]]||[[NXSL:format|format]]||[[NXSL:FindDCIByDescription|FindDCIByDescription]]||[[NXSL:GetInterfaceName|GetInterfaceName]]||[[NXSL:CreateNode|CreateNode]]||[[NXSL:gethostbyaddr|gethostbyaddr]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:exit|exit]]||[[NXSL:floor|floor]]||[[NXSL:index|index]]||[[NXSL:FindDCIByName|FindDCIByName]]||[[NXSL:GetInterfaceObject|GetInterfaceObject]]||[[NXSL:DeleteCustomAttribute|DeleteCustomAttribute]]||[[NXSL:gethostbyname|gethostbyname]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:GetConfigurationVariable|GetConfigurationVariable]]||[[NXSL:log|log]]||[[NXSL:left|left]]||[[NXSL:GetAvgDCIValue|GetAvgDCIValue]]||[[NXSL:GetNodeInterfaces|GetNodeInterfaces]]||[[NXSL:DeleteObject|DeleteObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:inList|inList]]||[[NXSL:log10|log10]]||[[NXSL:length|length]]||[[NXSL:GetDCIObject|GetDCIObject]]||[[NXSL:GetNodeParents|GetNodeParents]]||[[NXSL:EnterMaintenance|EnterMaintenance]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:map|map]]||[[NXSL:pow|pow]]||[[NXSL:lower|lower]]||[[NXSL:GetDCIRawValue|GetDCIRawValue]]||[[NXSL:GetNodeTemplates|GetNodeTemplates]]||[[NXSL:GetCustomAttribute|GetCustomAttribute]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:mapList|mapList]]||[[NXSL:round|round]]||[[NXSL:ltrim|ltrim]]||[[NXSL:GetDCIValue|GetDCIValue]]||[[NXSL:GetObjectChildren|GetObjectChildren]]||[[NXSL:LeaveMaintenance|LeaveMaintenance]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:max|max]]||||[[NXSL:ord|ord]]||[[NXSL:GetDCIValues|GetDCIValues]]||[[NXSL:GetObjectParents|GetObjectParents]]||[[NXSL:ManageObject|ManageObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:min|min]]||||[[NXSL:right|right]]||[[NXSL:GetDCIValueByDescription|GetDCIValueByDescription]]||[[NXSL:GetAllNodes|GetAllNodes]]||[[NXSL:RenameObject|RenameObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:random|random]]||||[[NXSL:rindex|rindex]]||[[NXSL:GetDCIValueByName|GetDCIValueByName]]||||[[NXSL:SetCustomAttribute|SetCustomAttribute]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:sleep|sleep]]||||[[NXSL:rtrim|rtrim]]||[[NXSL:GetMaxDCIValue|GetMaxDCIValue]]||||[[NXSL:SetInterfaceExpectedState|SetInterfaceExpectedState]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:trace|trace]]||||[[NXSL:SplitString|SplitString]]||[[NXSL:GetMinDCIValue|GetMinDCIValue]]||||[[NXSL:UnbindObject|UnbindObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:typeof|typeof]]||||[[NXSL:substr|substr]]||[[NXSL:GetSumDCIValue|GetSumDCIValue]]||||[[NXSL:UnmanageObject|UnmanageObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:x2d|x2d]]||||[[NXSL:trim|trim]]||[[NXSL:PushDCIData|PushDCIData]]||||||&lt;br /&gt;
|-&lt;br /&gt;
| ||||[[NXSL:upper|upper]]||||||||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| {border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;2&amp;quot; style=&amp;quot;border:\#c9c9c9 1px solid; margin: 1em 1em 1em 0; border-collapse: collapse;&amp;quot;}&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Time-related&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Cryptography&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;SNMP&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Agent&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Event Processing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Persistent Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;File I/O&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:gmtime|gmtime]]||[[NXSL:md5|md5]]||[[NXSL:CreateSNMPTransport|CreateSNMPTransport]]||[[NXSL:AgentReadList|AgentReadList]]||[[NXSL:FindAlarmById|FindAlarmById]]||[[NXSL:ReadPersistentStorage|ReadPersistentStorage]]||[[NXSL:CopyFile|CopyFile]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:localtime|localtime]]||[[NXSL:sha1|sha1]]||[[NXSL:SNMPGet|SNMPGet]]||[[NXSL:AgentReadParameter|AgentReadParameter]]||[[NXSL:FindAlarmByKey|FindAlarmByKey]]||[[NXSL:WritePersistentStorage|WritePersistentStorage]]||[[NXSL:CreateDirectory|CreateDirectory]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:SecondsToUptime|SecondsToUptime]]||[[NXSL:sha256|sha256]]||[[NXSL:SNMPGetValue|SNMPGetValue]]||[[NXSL:AgentReadTable|AgentReadTable]]||[[NXSL:FindAlarmByKeyRegex|FindAlarmByKeyRegex]]||||[[NXSL:DeleteFile|DeleteFile]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:strftime|strftime]]||||[[NXSL:SNMPSet|SNMPSet]]||||[[NXSL:GetEventParameter|GetEventParameter]]||||[[NXSL:FileAccess|FileAccess]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:time|time]]||||[[NXSL:SNMPWalk|SNMPWalk]]||||[[NXSL:PostEvent|PostEvent]]||||[[NXSL:OpenFile|OpenFile]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:mktime|mktime]]||||||||[[NXSL:SetEventParameter|SetEventParameter]]||||[[NXSL:RemoveDirectory|RemoveDirectory]]||&lt;br /&gt;
|-&lt;br /&gt;
| ||||||||||||[[NXSL:RenameFile|RenameFile]]||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Formal_Grammar&amp;diff=1778</id>
		<title>NXSL Formal Grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Formal_Grammar&amp;diff=1778"/>
		<updated>2020-10-05T14:20:22Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_formal_grammar NXSL Formal Grammar]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
script ::=&lt;br /&gt;
	module |&lt;br /&gt;
	expression&lt;br /&gt;
&lt;br /&gt;
module ::=&lt;br /&gt;
	module_component { module_component }&lt;br /&gt;
&lt;br /&gt;
module_component ::=&lt;br /&gt;
	function |&lt;br /&gt;
	statement_or_block |&lt;br /&gt;
	use_statement&lt;br /&gt;
&lt;br /&gt;
use_statement ::=&lt;br /&gt;
	use any_identifier &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
any_identifier ::=&lt;br /&gt;
	IDENTIFIER |&lt;br /&gt;
	COMPOUND_IDENTFIER&lt;br /&gt;
&lt;br /&gt;
function ::=&lt;br /&gt;
	sub IDENTIFIER &amp;quot;(&amp;quot; [ identifier_list ] &amp;quot;)&amp;quot; block&lt;br /&gt;
&lt;br /&gt;
identifier_list ::=&lt;br /&gt;
	IDENTIFIER { &amp;quot;,&amp;quot; IDENTIFIER }&lt;br /&gt;
&lt;br /&gt;
block ::=&lt;br /&gt;
	&amp;quot;{&amp;quot; { statement_or_block } &amp;quot;}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
statement_or_block ::=&lt;br /&gt;
	statement |&lt;br /&gt;
	block&lt;br /&gt;
&lt;br /&gt;
statement ::=&lt;br /&gt;
	expression &amp;quot;;&amp;quot; |&lt;br /&gt;
	builtin_statement |&lt;br /&gt;
	&amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
builtin_statement ::=&lt;br /&gt;
	simple_statement &amp;quot;;&amp;quot; |&lt;br /&gt;
	if_statement |&lt;br /&gt;
	do_statement |&lt;br /&gt;
	while_statement |&lt;br /&gt;
	for_statement |&lt;br /&gt;
	foreach_statement |&lt;br /&gt;
	switch_statement |&lt;br /&gt;
	array_statement |&lt;br /&gt;
	global_statement |&lt;br /&gt;
	break &amp;quot;;&amp;quot;&lt;br /&gt;
	continue &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
simple_statement ::=&lt;br /&gt;
	keyword [ expression ]&lt;br /&gt;
&lt;br /&gt;
keyword ::=&lt;br /&gt;
	exit |&lt;br /&gt;
	print |&lt;br /&gt;
	println |&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
if_statement ::=&lt;br /&gt;
	if &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block [ else statement_or_block ]&lt;br /&gt;
&lt;br /&gt;
for_statement ::=&lt;br /&gt;
	for &amp;quot;(&amp;quot; expression &amp;quot;;&amp;quot; expression &amp;quot;;&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
foreach_statement ::=&lt;br /&gt;
	foreach &amp;quot;(&amp;quot; IDENTIFIER &amp;quot;:&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
while_statement ::=&lt;br /&gt;
	while &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
do_statement ::=&lt;br /&gt;
	do statement_or_block while &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
switch_statement ::=&lt;br /&gt;
	switch &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; &amp;quot;{&amp;quot; case { case } [ default ] &amp;quot;}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case ::=&lt;br /&gt;
	case constant &amp;quot;:&amp;quot; { statement_or_block }&lt;br /&gt;
&lt;br /&gt;
default ::=&lt;br /&gt;
	default &amp;quot;:&amp;quot; { statement_or_block }&lt;br /&gt;
&lt;br /&gt;
array_statement ::=&lt;br /&gt;
	[ global ] array identifier_list &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
global_statement ::=&lt;br /&gt;
	global global_variable_declaration { &amp;quot;,&amp;quot; global_variable_declaration } &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
global_variable_declaration ::=&lt;br /&gt;
	IDENTIFIER [ &amp;quot;=&amp;quot; expression ]&lt;br /&gt;
&lt;br /&gt;
expression ::=&lt;br /&gt;
	&amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; |&lt;br /&gt;
	IDENTIFIER &amp;quot;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;-&amp;gt;&amp;quot; IDENTIFIER |&lt;br /&gt;
	&amp;quot;-&amp;quot; expression |&lt;br /&gt;
	&amp;quot;!&amp;quot; expression |&lt;br /&gt;
	&amp;quot;~&amp;quot; expression |&lt;br /&gt;
	inc IDENTIFIER |&lt;br /&gt;
	dec IDENTIFIER |&lt;br /&gt;
	IDENTIFIER inc |&lt;br /&gt;
	IDENTIFIER dec |&lt;br /&gt;
	expression &amp;quot;+&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;-&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;*&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;/&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;%&amp;quot; expression |&lt;br /&gt;
	expression like expression |&lt;br /&gt;
	expression ilike expression |&lt;br /&gt;
	expression &amp;quot;~=&amp;quot; expression |&lt;br /&gt;
	expression match expression |&lt;br /&gt;
	expression imatch expression |&lt;br /&gt;
	expression &amp;quot;==&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;!=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;amp;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;|&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;^&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;amp;&amp;amp;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;||&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;&amp;lt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;&amp;gt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;.&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;?&amp;quot; expression &amp;quot;:&amp;quot; expression |&lt;br /&gt;
	operand&lt;br /&gt;
&lt;br /&gt;
operand ::=&lt;br /&gt;
	function_call |&lt;br /&gt;
	type_cast |&lt;br /&gt;
	constant |&lt;br /&gt;
	IDENTIFIER&lt;br /&gt;
&lt;br /&gt;
type_cast ::=&lt;br /&gt;
	builtin_type &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
builtin_type ::=&lt;br /&gt;
	int32 |&lt;br /&gt;
	int64 |&lt;br /&gt;
	uint32 |&lt;br /&gt;
	uint64 |&lt;br /&gt;
	real |&lt;br /&gt;
	string&lt;br /&gt;
&lt;br /&gt;
function_call ::=&lt;br /&gt;
	IDENTIFIER &amp;quot;(&amp;quot; [ expression { &amp;quot;,&amp;quot; expression } ] &amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
constant ::=&lt;br /&gt;
	STRING |&lt;br /&gt;
	INT32 |&lt;br /&gt;
	INT64 |&lt;br /&gt;
	UINT32 |&lt;br /&gt;
	UINT64 |&lt;br /&gt;
	REAL |&lt;br /&gt;
	NULL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Terminal symbols&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IDENTIFIER ::= [A-Za-z_\$][A-Za-z_\$0-9]*&lt;br /&gt;
COMPOUND_IDENTIFIER ::= { IDENTIFIER}(::{ IDENTIFIER})+&lt;br /&gt;
INTEGER ::= \-?(0x)?[0-9]+&lt;br /&gt;
INT32 ::= INTEGER&lt;br /&gt;
INT64 ::= {INTEGER}L&lt;br /&gt;
UINT32 ::= {INTEGER}U&lt;br /&gt;
UINT64 ::= {INTEGER}(UL|LU)&lt;br /&gt;
REAL ::= \-?[0-9]+\.[0-9]+&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Setting_node_geolocation_from_SNMP&amp;diff=1777</id>
		<title>Script Example: Setting node geolocation from SNMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Setting_node_geolocation_from_SNMP&amp;diff=1777"/>
		<updated>2020-10-05T14:19:44Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adjust the OIDs in &amp;#039;&amp;#039;SNMPGetValue&amp;#039;&amp;#039; as required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
transport = CreateSNMPTransport($node);&lt;br /&gt;
if (transport == null) {&lt;br /&gt;
  return null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
lat = SNMPGetValue(transport, &amp;quot;.1.2.3.4.1&amp;quot;);&lt;br /&gt;
lon = SNMPGetValue(transport, &amp;quot;.1.2.3.4.2&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (lat == null || lon == null) {&lt;br /&gt;
  return null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
geoLoc = new GeoLocation(lat, lon);&lt;br /&gt;
$node-&amp;gt;setGeoLocation(geoLoc);&lt;br /&gt;
&lt;br /&gt;
return 0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Recursively_Collect_Values_from_Custom_Attributes&amp;diff=1776</id>
		<title>Script Example: Recursively Collect Values from Custom Attributes</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Recursively_Collect_Values_from_Custom_Attributes&amp;diff=1776"/>
		<updated>2020-10-05T14:19:35Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script recursively collects values of custom attribute &amp;#039;&amp;#039;&amp;#039;contacts&amp;#039;&amp;#039;&amp;#039; from all node parents. Collected values concatenated into single string and separated by semicolons. Duplicate values added only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
global contacts = &amp;quot;&amp;quot;;  // concatenated values will be stored here&lt;br /&gt;
global presence = %{ };  // value presence indicator (hash map)&lt;br /&gt;
&lt;br /&gt;
// walk through each parent object for current node&lt;br /&gt;
foreach(o : GetObjectParents($node))&lt;br /&gt;
{&lt;br /&gt;
	add_contacts(o);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Concatenated result is in &amp;quot;contacts&amp;quot; global variable&lt;br /&gt;
println &amp;quot;Contacts: &amp;quot; . contacts;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Recursively add contacts from object and it&amp;#039;s parents&lt;br /&gt;
 */&lt;br /&gt;
sub add_contacts(curr)&lt;br /&gt;
{&lt;br /&gt;
	c = GetCustomAttribute(curr, &amp;quot;contacts&amp;quot;);&lt;br /&gt;
	if ((c != null) &amp;amp;&amp;amp; (presence[c] == null))&lt;br /&gt;
	{&lt;br /&gt;
		if (length(contacts) &amp;gt; 0)&lt;br /&gt;
			contacts = contacts . &amp;quot;;&amp;quot; . c;&lt;br /&gt;
		else&lt;br /&gt;
			contacts = c;&lt;br /&gt;
		presence[c] = true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	foreach(o : GetObjectParents(curr))&lt;br /&gt;
	{&lt;br /&gt;
		add_contacts(o);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Read_Table_From_Agent&amp;diff=1775</id>
		<title>Script Example: Read Table From Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Read_Table_From_Agent&amp;diff=1775"/>
		<updated>2020-10-05T14:19:23Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script can be put into Script Library and run from server&amp;#039;s debug console. It accepts node object name or ID as first parameter, table name as second parameter, and prints content of given table to console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// Find node object&lt;br /&gt;
node = FindObject($1);&lt;br /&gt;
if (node == null)&lt;br /&gt;
{&lt;br /&gt;
	println &amp;quot;ERROR: Node not found&amp;quot;;&lt;br /&gt;
	return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// REad table data from agent&lt;br /&gt;
table = AgentReadTable(node, $2);&lt;br /&gt;
if (table == null)&lt;br /&gt;
{&lt;br /&gt;
	println &amp;quot;ERROR: Cannot read table from agent&amp;quot;;&lt;br /&gt;
	return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Print column names&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;columnCount; i++)&lt;br /&gt;
	print &amp;quot;| &amp;quot; . left(table-&amp;gt;getColumnName(i), 20);&lt;br /&gt;
println &amp;quot;|&amp;quot;;&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;columnCount; i++)&lt;br /&gt;
	print &amp;quot;+&amp;quot; . left(&amp;quot;-&amp;quot;, 21, &amp;quot;-&amp;quot;);&lt;br /&gt;
println &amp;quot;+&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Print data&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;rowCount; i++)&lt;br /&gt;
{&lt;br /&gt;
	for(j = 0; j &amp;lt; table-&amp;gt;columnCount; j++)&lt;br /&gt;
	{&lt;br /&gt;
		print &amp;quot;| &amp;quot; . left(table-&amp;gt;get(i, j), 20);&lt;br /&gt;
	}&lt;br /&gt;
	println &amp;quot;|&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Read_SNMP_Value_From_Node&amp;diff=1774</id>
		<title>Script Example: Read SNMP Value From Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Read_SNMP_Value_From_Node&amp;diff=1774"/>
		<updated>2020-10-05T14:19:13Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script can be put into Script Library and run from server&amp;#039;s debug console. It accepts node object name or ID as parameter and prints value of SNMP sysDescription to console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
if ($1 == null)&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Please specify node name as parameter&amp;quot;;&lt;br /&gt;
   return 3;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
transport = CreateSNMPTransport(FindObject($1));    // Create SNMP transport for node&lt;br /&gt;
if (transport == null)&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;Failed to create SNMP transport, exit&amp;quot;;&lt;br /&gt;
    return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
value = SNMPGetValue(transport, &amp;quot;.1.3.6.1.2.1.1.1.0&amp;quot;);&lt;br /&gt;
if (value == null)&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;Failed to issue SNMP GET request&amp;quot;;&lt;br /&gt;
    return 2;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;System description: &amp;quot; . value;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of script output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\Source\NetXMS\x64\debug&amp;gt;nxadm -c &amp;quot;exec GetSysDescr cisco-2600-central&amp;quot;&lt;br /&gt;
System description: Cisco IOS Software, C2600 Software (C2600-ADVSECURITYK9-M), Version 12.4(1a), RELEASE SOFTWARE (fc2)&lt;br /&gt;
Technical Support: http://www.cisco.com/techsupport&lt;br /&gt;
Copyright (c) 1986-2005 by Cisco Systems, Inc.&lt;br /&gt;
Compiled Fri 27-May-05 15:09 by hqluong&lt;br /&gt;
INFO: Script finished with rc=0&lt;br /&gt;
&lt;br /&gt;
C:\Source\NetXMS\x64\debug&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Aggregation_of_DCI_values_and_applying_the_95%25_percentile_average&amp;diff=1773</id>
		<title>Script Example: Aggregation of DCI values and applying the 95% percentile average</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Aggregation_of_DCI_values_and_applying_the_95%25_percentile_average&amp;diff=1773"/>
		<updated>2020-10-05T14:19:05Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The example is based around a template which configures ICMP Packet Loss probes. This script will loop around the nodes, collect the required DCI values. The values are then ordered and the top 5 percent discarded, the remaining entries are averaged to give the required value;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
trace(1, &amp;quot;Global Ping Loss 95&amp;quot;);&lt;br /&gt;
array pValue;&lt;br /&gt;
arrayI  = 0;&lt;br /&gt;
&lt;br /&gt;
foreach(parent : GetNodeParents($node))&lt;br /&gt;
{&lt;br /&gt;
	trace(3, &amp;quot;Parent object: name=&amp;#039;&amp;quot; . parent-&amp;gt;name .&amp;quot;&amp;#039; id=&amp;quot; . parent-&amp;gt;id);&lt;br /&gt;
	if (parent-&amp;gt;name == &amp;quot;all voice&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		foreach(vNode : GetObjectChildren(parent))&lt;br /&gt;
		{&lt;br /&gt;
			dciName = &amp;quot;ICMP: Packet loss to &amp;quot;.vNode-&amp;gt;name;&lt;br /&gt;
			dciId = FindDCIByDescription(vNode, dciName);&lt;br /&gt;
			if (dciId &amp;gt; 0)&lt;br /&gt;
			{&lt;br /&gt;
				tmpValue = GetDCIValue(vNode,dciId);				&lt;br /&gt;
				if (tmpValue != null)&lt;br /&gt;
				{&lt;br /&gt;
					pValue[arrayI++] = tmpValue;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Sort the Array&lt;br /&gt;
bubbleSort(pValue);&lt;br /&gt;
&lt;br /&gt;
// Apply the 95 percent rule&lt;br /&gt;
upTo = arrayI * 0.95;&lt;br /&gt;
pLoss = 0;&lt;br /&gt;
pCount = 0;&lt;br /&gt;
for(ia = 0; ia &amp;lt; upTo; ia++)&lt;br /&gt;
{&lt;br /&gt;
	pLoss += pValue[ia];&lt;br /&gt;
	pCount = ia;&lt;br /&gt;
}&lt;br /&gt;
p95AvgLoss = pLoss / pCount;&lt;br /&gt;
&lt;br /&gt;
trace(1, &amp;quot;Global Ping Loss 95 Summary: arrayI=&amp;quot;.arrayI.&amp;quot; upTo=&amp;quot;.upTo.&amp;quot; p95AvgLoss=&amp;quot;.p95AvgLoss );&lt;br /&gt;
&lt;br /&gt;
return p95AvgLoss;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub bubbleSort(arr)&lt;br /&gt;
{&lt;br /&gt;
	swapped = true;&lt;br /&gt;
	while (swapped == true){&lt;br /&gt;
		swapped = false;&lt;br /&gt;
		for(ia = 1; arr[ia] != null; ia++)&lt;br /&gt;
		{&lt;br /&gt;
			ib = ia - 1;&lt;br /&gt;
			&lt;br /&gt;
			if (arr[ib] &amp;gt; arr[ia]){&lt;br /&gt;
				trace(3,&amp;quot;swap: &amp;quot;.ib.&amp;quot;:&amp;quot;.arr[ib].&amp;quot; with &amp;quot;.ia.&amp;quot;:&amp;quot;.arr[ia]);&lt;br /&gt;
				swapped=true;&lt;br /&gt;
				t = arr[ib];&lt;br /&gt;
				arr[ib] = arr[ia];&lt;br /&gt;
				arr[ia] = t;&lt;br /&gt;
				swapped = true;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub printArray(arr)&lt;br /&gt;
{&lt;br /&gt;
	for(ia = 0; arr[ia] != null; ia++)&lt;br /&gt;
	{&lt;br /&gt;
		trace(1,&amp;quot;printArray: &amp;quot;.ia.&amp;quot;:&amp;quot;.arr[ia]);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Custom_Attributes_for_Node&amp;diff=1772</id>
		<title>Script Example: Enumerate All Custom Attributes for Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Custom_Attributes_for_Node&amp;diff=1772"/>
		<updated>2020-10-05T14:18:56Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Enumerate all custom attributes on a node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note: this script requires NetXMS version 2.0.2 or higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
attributes = $node-&amp;gt;customAttributes;&lt;br /&gt;
foreach(a : attributes-&amp;gt;keys)&lt;br /&gt;
{&lt;br /&gt;
        println a . &amp;quot;=&amp;quot; . attributes[a];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Nodes&amp;diff=1771</id>
		<title>Script Example: Enumerate All Nodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Nodes&amp;diff=1771"/>
		<updated>2020-10-05T14:18:45Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Enumerate all nodes in NetXMS database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Create script in script library which will find &amp;quot;Entire Networks&amp;quot; object and walk down the tree. This script can be executes as an action from event processing policy, or directly from server debug console via &amp;#039;&amp;#039;&amp;#039;exec&amp;#039;&amp;#039;&amp;#039; command.&lt;br /&gt;
&lt;br /&gt;
In order to be able to access info about all nodes, the &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039; server configuration variable needs to be set to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// Find &amp;quot;Entire Network&amp;quot; object and start enumeration from it&lt;br /&gt;
EnumerateNodes(FindObject(1));&lt;br /&gt;
&lt;br /&gt;
// This function walks object tree recursively starting from given root&lt;br /&gt;
sub EnumerateNodes(rootObject)&lt;br /&gt;
{&lt;br /&gt;
	// Walk all child objects&lt;br /&gt;
	foreach(o : GetObjectChildren(rootObject))&lt;br /&gt;
	{&lt;br /&gt;
		if (classof(o) == &amp;quot;Node&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			// Process node object&lt;br /&gt;
			trace(1, &amp;quot;  + &amp;quot; . o-&amp;gt;name);&lt;br /&gt;
		}&lt;br /&gt;
		else if (classof(o) == &amp;quot;NetObj&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			// For all other objects, go down the tree&lt;br /&gt;
			// There can be additional checks for object class, like&lt;br /&gt;
			// if (o-&amp;gt;type == 5)&lt;br /&gt;
			EnumerateNodes(o);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Additional_Information_About_Connected_Node&amp;diff=1770</id>
		<title>Script Example: Additional Information About Connected Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Additional_Information_About_Connected_Node&amp;diff=1770"/>
		<updated>2020-10-05T14:18:36Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Add information about name, IP address, and MAC address about connected node to notification about switch port being down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Use named event attribute &amp;#039;&amp;#039;additionalInfo&amp;#039;&amp;#039; to pass information into e-mail body (using %&amp;lt;additionalInfo&amp;gt; macro). To populate this attribute the following script can be used:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// only for interface up and down events&lt;br /&gt;
if (($event-&amp;gt;name != &amp;quot;SYS_IF_DOWN&amp;quot;) &amp;amp;&amp;amp; ($event-&amp;gt;name != &amp;quot;SYS_IF_UP&amp;quot;))&lt;br /&gt;
	return true;&lt;br /&gt;
	&lt;br /&gt;
// get interface object from interface index&lt;br /&gt;
iface = GetInterfaceObject($node, $5);&lt;br /&gt;
if (iface == null)&lt;br /&gt;
	return true;&lt;br /&gt;
&lt;br /&gt;
// get peer node (node connected to this interface) object&lt;br /&gt;
peer = iface-&amp;gt;peerNode;&lt;br /&gt;
if (peer == null)&lt;br /&gt;
	return true;&lt;br /&gt;
	&lt;br /&gt;
// get peer interface object (needed to obtain MAC address)&lt;br /&gt;
peerIface = iface-&amp;gt;peerInterface;&lt;br /&gt;
if (peerIface != null)&lt;br /&gt;
{&lt;br /&gt;
	macAddr = peerIface-&amp;gt;macAddr;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
	macAddr = &amp;quot;&amp;lt;MAC unknown&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set event&amp;#039;s named parameter	&lt;br /&gt;
SetEventParameter($event, &amp;quot;additionalInfo&amp;quot;,&lt;br /&gt;
	&amp;quot;Peer: &amp;quot; . peer-&amp;gt;name . &amp;quot; &amp;quot; . peer-&amp;gt;ipAddr . &amp;quot; &amp;quot; . macAddr);&lt;br /&gt;
&lt;br /&gt;
return true;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Script_Examples&amp;diff=1769</id>
		<title>SG:Script Examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Script_Examples&amp;diff=1769"/>
		<updated>2020-10-05T14:18:23Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_examples_2 NetXMS Script examples]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Additional Information About Connected Node|Additional Information About Connected Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Enumerate All Nodes|Enumerate All Nodes]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Enumerate All Custom Attributes for Node|Enumerate All Custom Attributes for Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Aggregation of DCI values and applying the 95% percentile average|Aggregation of DCI values and applying the 95% percentile average]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Read SNMP Value From Node|Read SNMP Value From Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Read Table From Agent|Read Table From Agent]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Recursively Collect Values from Custom Attributes|Recursively Collect Values from Custom Attributes]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Setting node geolocation from SNMP|Setting node geolocation from SNMP]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Security_Issues&amp;diff=1768</id>
		<title>SG:Security Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Security_Issues&amp;diff=1768"/>
		<updated>2020-10-05T14:17:30Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Security Issues}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#security Script security]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because NXSL provides functions for searching objects, and because all scripts are executed on management server, user with write access to only one node can potentially acquire information about nodes to which he normally does not have access. For example, without additional security checks user with write access to node A and no access to node B can create transformation script for DCI on node A and use [[NXSL:FindNodeObject|FindNodeObject]] function to access node B and get information about it, thus breaking security settings.&lt;br /&gt;
&lt;br /&gt;
To prevent such scenario, all NXSL functions capable of accessing NetXMS objects requires &amp;quot;current node&amp;quot; object to be provided. Reference to object being searched will only be returned if node object supplied as &amp;quot;current node&amp;quot; is in trusted nodes list of target object. For example, if variable &amp;#039;&amp;#039;&amp;#039;$node&amp;#039;&amp;#039;&amp;#039; in script refers to NODE1, and [[NXSL:FindNodeObject|FindNodeObject]]($node, &amp;quot;NODE2&amp;quot;) called, NODE1 must be added to list of trusted nodes for NODE2. In most places (transformation script, event processing policy, etc.) predefined variable &amp;#039;&amp;#039;&amp;#039;$node&amp;#039;&amp;#039;&amp;#039; exists, which refers to node object on behalf of which script is being executed. It will be event source for event processing policy script, DCI owner for transformation script, and so on.&lt;br /&gt;
&lt;br /&gt;
For environments where such strict security checks are not required (for example, all users have read access to all nodes), they can be disabled to simplify configuration. Enforcement of trusted nodes checking controlled by server&amp;#039;s configuration variable &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039;. By default it is set to &amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039; and check of trusted nodes is not enforced. To enable it, server&amp;#039;s configuration variable &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039; must be set to &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;. The server restart is required to make this change effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=UM:NetXMS_Scripting_Language_(NXSL)&amp;diff=1767</id>
		<title>UM:NetXMS Scripting Language (NXSL)</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=UM:NetXMS_Scripting_Language_(NXSL)&amp;diff=1767"/>
		<updated>2020-10-05T14:16:59Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:NetXMS Scripting Language (NXSL)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/#_language_syntax Language syntax]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= NXSL Overview =&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Hello, World!&amp;quot; Program =&lt;br /&gt;
Syntactically, NXSL looks similar to Perl or C. Here&amp;#039;s simple NXSL program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program will print word &amp;#039;&amp;#039;Hello&amp;#039;&amp;#039; on screen.&lt;br /&gt;
&lt;br /&gt;
Also, keep in mind that you are free to choose your own formatting style. E.g. the above could have been written as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */ sub main(){println &amp;quot;Hello!&amp;quot;;return 0;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&amp;#039;ll analyze this program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Everything inside /* */ is considered a comment and will be ignored by interpreter. You can enclose comments, like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* comment /* another comment */ still comment */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use single line comments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
x = 1; // everything between two slashes and end of line is a comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now onto next line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a function definition. A function is a part of a program that can be called by other parts of the program. A function definition always has the following form: &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;parameters&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{&lt;br /&gt;
   /* the function code goes here */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The function can return a value to the caller and accept zero or more parameters.&lt;br /&gt;
&lt;br /&gt;
The function name follows the rules for all names (formally: identifiers): it must consist entirely of letters (uppercase and lowercase are different!), digits, underscores (_) and dollar signs ($), but may not begin with a digit. Please note that most special identifiers starts with dollar sign ($), so it is recommended not to start your identifiers with it.&lt;br /&gt;
&lt;br /&gt;
First line in function code looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this line, println is an embedded operator which prints given string to standard output with carriage return, and &amp;quot;Hello!&amp;quot; is a string we want to print. Please note semicolon at the end of line – it&amp;#039;s a separator between operators. Each operator should end with semicolon.&lt;br /&gt;
&lt;br /&gt;
The next, and final, line of our small program is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
return 0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return is another built-in operator which exits the function and sets it&amp;#039;s return value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Script entry point =&lt;br /&gt;
NXSL handles script entry in 2 ways:&amp;lt;br&amp;gt;&lt;br /&gt;
* Explicit main() function&lt;br /&gt;
* Implicit $main() fucntion&lt;br /&gt;
&lt;br /&gt;
If an explicitelly defined main() exists, it will be called.&lt;br /&gt;
&lt;br /&gt;
If an explicit main() doesnt exist, an implicit $main() fucntion will be created by the script interpreter and the script will enter at the $main() function.&amp;lt;br&amp;gt;&lt;br /&gt;
The $main() fucntion is constructed from code that is not a part of any other functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types =&lt;br /&gt;
NXSL is loose typed programming language. The system will automatically determine each variable type, assign a certain type to a variable and convert a variable type from one to another, if necessary. For example, a result for &amp;lt;tt&amp;gt;3 + &amp;quot;4&amp;quot;&amp;lt;/tt&amp;gt; will be 7, because the system will automatically convert &amp;lt;tt&amp;gt;&amp;quot;4&amp;quot;&amp;lt;/tt&amp;gt; string into an integer. In case if the system is not able to automatically convert a line into an appropriate integer, the operation will result in a runtime error.&lt;br /&gt;
&lt;br /&gt;
NXSL supports the following variable types:&lt;br /&gt;
&lt;br /&gt;
* integer (32 bit),&lt;br /&gt;
* unsigned integer (32 bit), &lt;br /&gt;
* integer (64 bit), unsigned integer (64 bit), &lt;br /&gt;
* floating-point number, &lt;br /&gt;
* string,&lt;br /&gt;
* array,&lt;br /&gt;
* object.&lt;br /&gt;
&lt;br /&gt;
In addition to that, NXSL also supports a special variable type – NULL. This value represents a variable with no value. NULL is the only possible value of type NULL. An attempt to perform any type of arithmetical or string operations with NULL variable will result in system runtime error.&lt;br /&gt;
&lt;br /&gt;
It is possible to manually convert variable to a certain type, using a special function, named depending on the variable type. For example, &amp;lt;tt&amp;gt;string(4)&amp;lt;/tt&amp;gt;. That way it is also possible to convert NULL type variables. Therefore, to avoid runtime errors while processing NULL type variables, it is advised to use manual conversion.&lt;br /&gt;
&lt;br /&gt;
NXSL does not require setting variable type beforehand. The only exception to this is arrays. In case if an array is required, operator &amp;lt;tt&amp;gt;array &amp;lt;/tt&amp;gt;defines its subsequent variables as arrays. Accessing variable which was not previously assigned will return NULL value.&lt;br /&gt;
&lt;br /&gt;
Although NXSL has object type variables, it is not an object-oriented language. It is not possible to define classes or create objects at script level – only in extensions written in C++. Object type variables are used to return information about complex NetXMS objects, like nodes or events, in a convenient way. Please note that assigning object type variables actually holds reference to an object, so assigning object value to another variable does not duplicate actual object, but just copy reference to it.&lt;br /&gt;
&lt;br /&gt;
To get a human-readable representation of a variable or expression type for debugging, use the &amp;lt;tt&amp;gt;typeof()&amp;lt;/tt&amp;gt; function, and to get a class name for object type variables, use &amp;lt;tt&amp;gt;classof()&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
Variables in NXSL behave the same way as variables in most popular programming languages (C, C++, etc.) do, but in NXSL you don&amp;#039;t have to declare variables before you use them. &lt;br /&gt;
&lt;br /&gt;
Scope of a variable can be either global (visible in any function in the script) or local (visible only in the function within which it was defined). Any variable is by default limited to the local function scope. Variable can be declared global using &amp;#039;&amp;#039;&amp;#039;global&amp;#039;&amp;#039;&amp;#039; operator.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
x = 1;&lt;br /&gt;
myFunction();&lt;br /&gt;
&lt;br /&gt;
sub myFunction()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;x=&amp;quot; . x;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script will cause run time error &amp;quot;Error 5 in line 6: Invalid operation with NULL value&amp;quot;, because variable &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; is local (in implicit main function) and is not visible in function &amp;#039;&amp;#039;&amp;#039;myFunction&amp;#039;&amp;#039;&amp;#039;. The following script will produce expected result (prints x=1):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
global x = 1;&lt;br /&gt;
myFunction();&lt;br /&gt;
&lt;br /&gt;
sub myFunction()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;x=&amp;quot; . x;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
A function is a named code block that is generally intended to process specified input values into an output value, although this is not always the case. For example, the [[NXSL:trace|trace]] function takes variables and static text and prints the values into server log. Like many languages, NXSL provides for user-defined functions. These may be located anywhere in the main program or loaded in from other scripts via the use keywords.&lt;br /&gt;
To define a function, you can use the following form:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;ARGUMENTS&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;BLOCK&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; is any valid identifier, &amp;#039;&amp;#039;ARGUMENTS&amp;#039;&amp;#039; is optional list of argument names, and &amp;#039;&amp;#039;BLOCK&amp;#039;&amp;#039; is code block.&lt;br /&gt;
&lt;br /&gt;
To call a function you would use the following form:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;LIST&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; is identifier used in function definition, and &amp;#039;&amp;#039;LIST&amp;#039;&amp;#039; is an optional list of expressions passed as function arguments.&lt;br /&gt;
&lt;br /&gt;
To give a quick example of a simple subroutine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub message()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function Arguments ==&lt;br /&gt;
&lt;br /&gt;
The first argument you pass to the function is available within the function as $1, the second argument is $2, and so on. For example, this simple function adds two numbers and prints the result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub add()&lt;br /&gt;
{&lt;br /&gt;
   result = $1 + $2;&lt;br /&gt;
   println &amp;quot;The result was: &amp;quot; . result;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To call the subroutine and get a result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
add(1, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want named arguments, list of aliases for $1, $2, etc. can be provided in function declaration inside the brackets:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub add(numberA, numberB)&lt;br /&gt;
{&lt;br /&gt;
   result = numberA + numberB;&lt;br /&gt;
   println &amp;quot;The result was: &amp;quot; . result;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If parameter was not provided at function call, value of appropriate variable will be &amp;#039;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Return Values from a Function ==&lt;br /&gt;
&lt;br /&gt;
You can return a value from a function using the &amp;#039;&amp;#039;&amp;#039;return&amp;#039;&amp;#039;&amp;#039; keyword:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub pct(value, total)&lt;br /&gt;
{&lt;br /&gt;
   return value / total * 100.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When called, return immediately terminates the current function and returns the value to the caller. If you don&amp;#039;t specify a value in &amp;#039;&amp;#039;&amp;#039;return&amp;#039;&amp;#039;&amp;#039; statement or function ends implicitly by reaching end of function&amp;#039;s block, then the return value is &amp;#039;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Arrays =&lt;br /&gt;
An array in NXSL is actually an ordered map. A map is a type that associates &amp;#039;&amp;#039;values&amp;#039;&amp;#039; to &amp;#039;&amp;#039;keys&amp;#039;&amp;#039;. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays. &lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;key&amp;#039;&amp;#039; must be a non-negative integer. When an array is created, its size is not specified and its map can have empty spots in it. For example, an array can have a element with a &amp;#039;&amp;#039;0&amp;#039;&amp;#039; key and an element with &amp;#039;&amp;#039;4&amp;#039;&amp;#039; key and no keys in-between. Attempting to access an array key which has not been defined is the same as accessing any other undefined variable: the result will be &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Array elements can be accessed using [&amp;#039;&amp;#039;index&amp;#039;&amp;#039;] operator. For example, to access element with index 3 of array &amp;#039;&amp;#039;a&amp;#039;&amp;#039; you should use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
a[3];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Array Initialization ==&lt;br /&gt;
&lt;br /&gt;
New array can be created in two ways. First is to use &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039; operator. &amp;lt;br&amp;gt;&lt;br /&gt;
This statement will create empty array and assign reference to it to variable &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
array a;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can then assign values to the array like this.&amp;lt;br&amp;gt;&lt;br /&gt;
Please note arrays in NXSL are sparse, so you can have elements with nothing in between.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
array a;&lt;br /&gt;
&lt;br /&gt;
a[1] = 1;&lt;br /&gt;
a[2] = 2;&lt;br /&gt;
a[260] = 260;&lt;br /&gt;
&lt;br /&gt;
println(a[1]); // will print 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second way is to use %( ) construct to create array already populated with values.&amp;lt;br&amp;gt;&lt;br /&gt;
This statement will create array with four elements at positions 0, 1, 2, and 3, and assign reference to this array to variable &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// no need to use &amp;quot;array a;&amp;quot; here, since we are creating it dirrectly&lt;br /&gt;
a = %(1, 2, 3, 4);&lt;br /&gt;
&lt;br /&gt;
println(a[0]); // will actually print 1, since 1 is the 0th member&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Array initialization can also be used directly in expressions, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub f()&lt;br /&gt;
{&lt;br /&gt;
   return %(2, &amp;quot;text&amp;quot;, %(1, 2, 3));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example function &amp;#039;&amp;#039;f&amp;#039;&amp;#039; returns array of 3 elements - number, text, and another array of 3 numeric elements.&lt;br /&gt;
&lt;br /&gt;
= Operators =&lt;br /&gt;
An operator is something that you feed with one or more values, which yields another value.&lt;br /&gt;
&lt;br /&gt;
== Arithmetic Operators ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Example !! Name !! Result&lt;br /&gt;
|-&lt;br /&gt;
| -a || Negation || Opposite of &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a + b || Addition || Sum of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a - b || Subtraction || Difference of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a * b || Multiplication || Product of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a / b || Division || Quotient of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a % b || Modulus || Remainder of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; divided by &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
The division operator (&amp;quot;/&amp;quot;) returns a float value unless the two operands are integers (or strings that get converted to integers) and the numbers are evenly divisible, in which case an integer value will be returned. &lt;br /&gt;
&lt;br /&gt;
Calling modulus on float operands will yield runtime error. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assignment Operator ==&lt;br /&gt;
The assignment operator is &amp;quot;=&amp;quot;, which means that the left operand gets set to the value of the expression on the rights (that is, &amp;quot;gets set to&amp;quot;). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bitwise Operators ==&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ~ a &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in &amp;#039;&amp;#039;a&amp;#039;&amp;#039; are not set, and vice versa. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;amp; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| And&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in both operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a | b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Or&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in either operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a ^ b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Xor&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in only one operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt;&amp;lt; b&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift left&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift the bits of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; &amp;#039;&amp;#039;b&amp;#039;&amp;#039; steps to the left (each step means &amp;quot;multiply by two&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt;&amp;gt; b &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift right&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift the bits of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; &amp;#039;&amp;#039;b&amp;#039;&amp;#039; steps to the right (each step means &amp;quot;divide by two&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Comparison Operators ==&lt;br /&gt;
Comparison operators allow you to compare two values. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Table 3: Comparison Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a == b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Equal&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a != b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not equal&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is not equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt; b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Less than&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is strictly less than &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Greater than&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is strictly greater than &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt;= b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Less than or equal to &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is less than or equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt;= b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Greater than or equal to &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is greater than or equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a ~= b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039;. As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a match b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039;. As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a imatch b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match (case insensitive)&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039; (case insensitive). As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Incrementing/Decrementing Operators ==&lt;br /&gt;
NXSL supports C-style pre- and post-increment and decrement operators. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Table 4: Incrementing/Decrementing Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Effect&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ++a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Pre-increment&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Increments &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one, then returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a++&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Post-increment&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, then increments &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| --a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Pre-decrement&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Decrements &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one, then returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a--&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Post-decrement&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, then decrements &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Logical Operators ==&lt;br /&gt;
&amp;#039;&amp;#039;Table 5: Logical Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ! a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is not &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;amp;&amp;amp; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| And&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if both &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039; is &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Or&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if either &amp;#039;&amp;#039;a&amp;#039;&amp;#039; or &amp;#039;&amp;#039;b&amp;#039;&amp;#039; is &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== String Operators ==&lt;br /&gt;
There are two string operators. The first is the concatenation operator (&amp;#039;.&amp;#039;), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator (&amp;#039;&amp;#039;&amp;#039;.=&amp;#039;&amp;#039;&amp;#039;), which appends the argument on the right side to the argument on the left side.&lt;br /&gt;
&lt;br /&gt;
= Control structures =&lt;br /&gt;
Any NXSL script is built out of a series of statements. A statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing (an empty statement). Statements usually end with a semicolon. In addition, statements can be grouped into a statement-group by encapsulating a group of statements with curly braces. A statement-group is a statement by itself as well. The various statement types are supported: &lt;br /&gt;
&lt;br /&gt;
* if&lt;br /&gt;
&lt;br /&gt;
* else&lt;br /&gt;
* while&lt;br /&gt;
* do-while&lt;br /&gt;
* for&lt;br /&gt;
* break&lt;br /&gt;
* continue&lt;br /&gt;
* switch&lt;br /&gt;
* return&lt;br /&gt;
* exit&lt;br /&gt;
&lt;br /&gt;
== if ==&lt;br /&gt;
The &amp;#039;&amp;#039;if&amp;#039;&amp;#039; construct is one of the most important features of many languages. It allows for conditional execution of code fragments. NXSL features an &amp;#039;&amp;#039;if&amp;#039;&amp;#039; structure that is similar to that of C: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if (expr)&lt;br /&gt;
   statement&lt;br /&gt;
&lt;br /&gt;
== else ==&lt;br /&gt;
Often you&amp;#039;d want to execute a statement if a certain condition is met, and a different statement if the condition is not met. This is what &amp;#039;&amp;#039;else&amp;#039;&amp;#039; is for. &amp;#039;&amp;#039;else&amp;#039;&amp;#039; extends an &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statement to execute a statement in case the expression in the &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statement evaluates to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;. The &amp;#039;&amp;#039;else&amp;#039;&amp;#039; statement is only executed if the &amp;#039;&amp;#039;if&amp;#039;&amp;#039; expression evaluated to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== while ==&lt;br /&gt;
&amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops are the simplest type of loop in NXSL. They behave just like their C counterparts. The basic form of a &amp;#039;&amp;#039;while&amp;#039;&amp;#039; statement is: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 while (expr)&lt;br /&gt;
     statement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The meaning of a &amp;#039;&amp;#039;while&amp;#039;&amp;#039; statement is simple. It tells NXSL to execute the nested statement(s) repeatedly, as long as the &amp;#039;&amp;#039;while&amp;#039;&amp;#039; expression evaluates to &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;. The value of the expression is checked each time at the beginning of the loop, so even if this value changes during the execution of the nested statement(s), execution will not stop until the end of the iteration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== do-while ==&lt;br /&gt;
&amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; loops are very similar to &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops, except the truth expression is checked at the end of each iteration instead of in the beginning. The main difference from regular &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops is that the first iteration of a &amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; loop is guaranteed to run (the truth expression is only checked at the end of the iteration), whereas it may not necessarily run with a regular &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loop (the truth expression is checked at the beginning of each iteration, if it evaluates to FALSE right from the beginning, the loop execution would end immediately).&lt;br /&gt;
&lt;br /&gt;
== for ==&lt;br /&gt;
&amp;#039;&amp;#039;for&amp;#039;&amp;#039; loops are the most complex loops in NXSL. They behave like their C counterparts. The syntax of a &amp;#039;&amp;#039;for&amp;#039;&amp;#039; loop is: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 for (expr1; expr2; expr3)&lt;br /&gt;
     statement&lt;br /&gt;
&lt;br /&gt;
The first expression (&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;) is evaluated (executed) once unconditionally at the beginning of the loop. &lt;br /&gt;
&lt;br /&gt;
In the beginning of each iteration, &amp;#039;&amp;#039;expr2&amp;#039;&amp;#039; is evaluated. If it evaluates to &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;, the loop continues and the nested statement(s) are executed. If it evaluates to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;, the execution of the loop ends. &lt;br /&gt;
&lt;br /&gt;
At the end of each iteration, &amp;#039;&amp;#039;expr3&amp;#039;&amp;#039; is evaluated (executed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== break ==&lt;br /&gt;
&amp;#039;&amp;#039;break&amp;#039;&amp;#039; ends execution of the current &amp;#039;&amp;#039;for&amp;#039;&amp;#039;, &amp;#039;&amp;#039;while&amp;#039;&amp;#039;, &amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; or &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; structure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== continue ==&lt;br /&gt;
&amp;#039;&amp;#039;continue&amp;#039;&amp;#039; is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== switch ==&lt;br /&gt;
The &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; statement is similar to a series of &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statements on the same expression. In many occasions, you may want to compare the same variable (or expression) with many different values, and execute a different piece of code depending on which value it equals to. This is exactly what the &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; statement is for.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  switch (input) &lt;br /&gt;
  {&lt;br /&gt;
    case &amp;quot;1&amp;quot;:&lt;br /&gt;
      trace(0,&amp;quot;Input is 1&amp;quot;);&lt;br /&gt;
      break;&lt;br /&gt;
    case &amp;quot;2&amp;quot;:&lt;br /&gt;
      trace(0,&amp;quot;Input is 2&amp;quot;);&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      trace(0, &amp;quot;Input is unknown&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== return ==&lt;br /&gt;
If called from within a function, the &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; statement immediately ends execution of the current function, and returns its argument as the value of the function call. Calling &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; from main() function (either explicitly or implicitly defined) is equivalent of calling &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== exit ==&lt;br /&gt;
The &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt; statement immediately ends execution of the entire script, and returns its argument as script execution result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Expressions =&lt;br /&gt;
The simplest yet most accurate way to define an expression is &amp;quot;anything that has a value&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The most basic forms of expressions are constants and variables. When you type &amp;quot;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; = 5&amp;quot;, you&amp;#039;re assigning &amp;#039;5&amp;#039; into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;. &amp;#039;5&amp;#039;, obviously, has the value 5, or in other words &amp;#039;5&amp;#039; is an expression with the value of 5 (in this case, &amp;#039;5&amp;#039; is an integer constant).&lt;br /&gt;
&lt;br /&gt;
Slightly more complex examples for expressions are functions. Functions are expressions with the value of their return value. &lt;br /&gt;
&lt;br /&gt;
NXSL supports the following value types: integer values, floating point values (float), string values and arrays. Each of these value types can be assigned into variables or returned from functions. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another good example of expression orientation is pre- and post-increment and decrement. You be familiar with the notation of &amp;#039;&amp;#039;variable++&amp;#039;&amp;#039; and &amp;#039;&amp;#039;variable--&amp;#039;&amp;#039;. These are increment and decrement operators. In NXSL, like in C, there are two types of increment - pre-increment and post-increment. Both pre-increment and post-increment essentially increment the variable, and the effect on the variable is identical. The difference is with the value of the increment expression. Pre-increment, which is written &amp;#039;++&amp;#039;&amp;#039;variable&amp;#039;&amp;#039;&amp;#039;, evaluates to the incremented value. Post-increment, which is written &amp;#039;&amp;#039;&amp;#039;variable&amp;#039;&amp;#039;++&amp;#039; evaluates to the original value of variable, before it was incremented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A very common type of expressions are comparison expressions. These expressions evaluate to either &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&amp;lt;nowiki&amp;gt; NXSL supports &amp;gt; (bigger than), &amp;gt;= (bigger than or equal to), = (equal), != (not equal), &amp;lt; (smaller than) and &amp;lt;= (smaller than or equal to). These expressions are most commonly used inside conditional execution, such as &amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;if&amp;#039;&amp;#039; statements. &lt;br /&gt;
&lt;br /&gt;
The last example of expressions is combined operator-assignment expressions. You already know that if you want to increment &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by 1, you can simply write &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;++&amp;#039; or &amp;#039;++&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039;. But what if you want to add more than one to it, for instance 3? In NXSL, adding 3 to the current value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; can be written &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; += 3&amp;#039;. This means exactly &amp;quot;take the value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, add 3 to it, and assign it back into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;quot;. In addition to being shorter and clearer, this also results in faster execution. The value of &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; += 3&amp;#039;, like the value of a regular assignment, is the assigned value. Notice that it is NOT 3, but the combined value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; plus 3 (this is the value that&amp;#039;s assigned into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;). Any two-place operator can be used in this operator-assignment mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Short-circuit evaluation ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Short-circuit_evaluation Short-circuit evaluation] denotes the semantics of some Boolean operators in which the second argument is only executed or evaluated if the first argument does not suffice to determine the value of the expression: when the first argument of the AND function evaluates to false, the overall value must be false; and when the first argument of the OR function evaluates to true, the overall value must be true. NXSL uses short-circuit evaluation for &amp;amp;&amp;amp; and || boolean operators. This feature permits two useful programming constructs. Firstly, if the first sub-expression checks whether an expensive computation is needed and the check evaluates to false, one can eliminate expensive computation in the second argument. Secondly, it permits a construct where the first expression guarantees a condition without which the second expression may cause a run-time error. Both are illustrated in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
if ((x != null) &amp;amp;&amp;amp; ((trim(x) == &amp;quot;abc&amp;quot;) || (long_running_test(x)))  &lt;br /&gt;
   do_something();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Without short-circuit evaluation, trim(x) would cause run-time error if x is null. Also, long running function will only be called if condition (trim(x) == &amp;quot;abc&amp;quot;) will be false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Syntax_highlight_and_calltips&amp;diff=1766</id>
		<title>NXSL Syntax highlight and calltips</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Syntax_highlight_and_calltips&amp;diff=1766"/>
		<updated>2020-10-05T13:55:31Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
If you want to edit your NXSL scripts in an external editor to make use of syntax highlighing and calltips, you can use Notepad++.&lt;br /&gt;
&lt;br /&gt;
Notepad++ is a free source code editor, governed by the GPL License.&lt;br /&gt;
&lt;br /&gt;
You can get Notepad++ here:&amp;lt;br&amp;gt;&lt;br /&gt;
http://notepad-plus-plus.org/download/&lt;br /&gt;
&lt;br /&gt;
= Calltips =&lt;br /&gt;
[[File:NSXL - calltips.png]]&lt;br /&gt;
&lt;br /&gt;
= Syntax highlight =&lt;br /&gt;
[[File:NXSL - syntax highlighting.png]]&lt;br /&gt;
&lt;br /&gt;
= How to import into Notepad++ =&lt;br /&gt;
For syntax highlight, import the syntax file using:&amp;lt;br&amp;gt;&lt;br /&gt;
   Language &amp;gt; Define your language... &amp;gt; Import&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For calltips, copy and rename the calltips file into:&amp;lt;br&amp;gt;&lt;br /&gt;
   C:\Program Files (x86)\Notepad++\plugins\APIs\NetXMS.xml&lt;br /&gt;
&lt;br /&gt;
= Getting the files =&lt;br /&gt;
&lt;br /&gt;
You can get more information and download the newest versions at:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.netxms.org/forum/general-support/netxms-notepad-syntax-highlight/&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Class_Reference&amp;diff=1765</id>
		<title>NXSL Class Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Class_Reference&amp;diff=1765"/>
		<updated>2020-10-05T13:55:05Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===NetObj and its sub-classes===&lt;br /&gt;
[[NXSL:NetObj|NetObj]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Cluster|Cluster]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Interface|Interface]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Node|Node]]&lt;br /&gt;
&lt;br /&gt;
- [[NXSL:Zone|Zone]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SNMP related classes===&lt;br /&gt;
[[NXSL:SNMP_Transport|SNMP_Transport]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:SNMP_VarBind|SNMP_VarBind]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other classes===&lt;br /&gt;
[[NXSL:Alarm|Alarm]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Component|Component]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:DCI|DCI]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Event|Event]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:FILE|FILE]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:GeoLocation|GeoLocation]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:InetAddress|InetAddress]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:NewNode|NewNode]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Situation|Situation]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:Table|Table]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:TableColumn|TableColumn]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:TIME|TIME]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL:UserDBObject|UserDBObject]]&lt;br /&gt;
&lt;br /&gt;
-[[NXSL:User|User]]&lt;br /&gt;
&lt;br /&gt;
-[[NXSL:UserGroup|UserGroup]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Function_Reference&amp;diff=1764</id>
		<title>NXSL Function Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Function_Reference&amp;diff=1764"/>
		<updated>2020-10-05T13:54:17Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Function tables =&lt;br /&gt;
{| {border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;2&amp;quot; style=&amp;quot;border:\#c9c9c9 1px solid; margin: 1em 1em 1em 0; border-collapse: collapse;&amp;quot;}&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Generic&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Math&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;String-related&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Data Collection&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Object search&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Object management&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:CountScheduledTasksByKey|CountScheduledTasksByKey]]||[[NXSL:abs|abs]]||[[NXSL:ArrayToString|ArrayToString]]||[[NXSL:CreateDCI|CreateDCI]]||[[NXSL:FindNodeObject|FindNodeObject]]||[[NXSL:BindObject|BindObject]]||[[NXSL:AddrInRange|AddrInRange]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:classof|classof]]||[[NXSL:ceil|ceil]]||[[NXSL:chr|chr]]||[[NXSL:FindAllDCIs|FindAllDCIs]]||[[NXSL:FindObject|FindObject]]||[[NXSL:CreateContainer|CreateContainer]]||[[NXSL:AddrInSubnet|AddrInSubnet]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:d2x|d2x]]||[[NXSL:exp|exp]]||[[NXSL:format|format]]||[[NXSL:FindDCIByDescription|FindDCIByDescription]]||[[NXSL:GetInterfaceName|GetInterfaceName]]||[[NXSL:CreateNode|CreateNode]]||[[NXSL:gethostbyaddr|gethostbyaddr]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:exit|exit]]||[[NXSL:floor|floor]]||[[NXSL:index|index]]||[[NXSL:FindDCIByName|FindDCIByName]]||[[NXSL:GetInterfaceObject|GetInterfaceObject]]||[[NXSL:DeleteCustomAttribute|DeleteCustomAttribute]]||[[NXSL:gethostbyname|gethostbyname]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:GetConfigurationVariable|GetConfigurationVariable]]||[[NXSL:log|log]]||[[NXSL:left|left]]||[[NXSL:GetAvgDCIValue|GetAvgDCIValue]]||[[NXSL:GetNodeInterfaces|GetNodeInterfaces]]||[[NXSL:DeleteObject|DeleteObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:inList|inList]]||[[NXSL:log10|log10]]||[[NXSL:length|length]]||[[NXSL:GetDCIObject|GetDCIObject]]||[[NXSL:GetNodeParents|GetNodeParents]]||[[NXSL:EnterMaintenance|EnterMaintenance]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:map|map]]||[[NXSL:pow|pow]]||[[NXSL:lower|lower]]||[[NXSL:GetDCIRawValue|GetDCIRawValue]]||[[NXSL:GetNodeTemplates|GetNodeTemplates]]||[[NXSL:GetCustomAttribute|GetCustomAttribute]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:mapList|mapList]]||[[NXSL:round|round]]||[[NXSL:ltrim|ltrim]]||[[NXSL:GetDCIValue|GetDCIValue]]||[[NXSL:GetObjectChildren|GetObjectChildren]]||[[NXSL:LeaveMaintenance|LeaveMaintenance]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:max|max]]||||[[NXSL:ord|ord]]||[[NXSL:GetDCIValues|GetDCIValues]]||[[NXSL:GetObjectParents|GetObjectParents]]||[[NXSL:ManageObject|ManageObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:min|min]]||||[[NXSL:right|right]]||[[NXSL:GetDCIValueByDescription|GetDCIValueByDescription]]||[[NXSL:GetAllNodes|GetAllNodes]]||[[NXSL:RenameObject|RenameObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:random|random]]||||[[NXSL:rindex|rindex]]||[[NXSL:GetDCIValueByName|GetDCIValueByName]]||||[[NXSL:SetCustomAttribute|SetCustomAttribute]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:sleep|sleep]]||||[[NXSL:rtrim|rtrim]]||[[NXSL:GetMaxDCIValue|GetMaxDCIValue]]||||[[NXSL:SetInterfaceExpectedState|SetInterfaceExpectedState]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:trace|trace]]||||[[NXSL:SplitString|SplitString]]||[[NXSL:GetMinDCIValue|GetMinDCIValue]]||||[[NXSL:UnbindObject|UnbindObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:typeof|typeof]]||||[[NXSL:substr|substr]]||[[NXSL:GetSumDCIValue|GetSumDCIValue]]||||[[NXSL:UnmanageObject|UnmanageObject]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:x2d|x2d]]||||[[NXSL:trim|trim]]||[[NXSL:PushDCIData|PushDCIData]]||||||&lt;br /&gt;
|-&lt;br /&gt;
| ||||[[NXSL:upper|upper]]||||||||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| {border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;2&amp;quot; style=&amp;quot;border:\#c9c9c9 1px solid; margin: 1em 1em 1em 0; border-collapse: collapse;&amp;quot;}&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Time-related&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Cryptography&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;SNMP&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Agent&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Event Processing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;Persistent Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&amp;#039;&amp;#039;&amp;#039;File I/O&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:gmtime|gmtime]]||[[NXSL:md5|md5]]||[[NXSL:CreateSNMPTransport|CreateSNMPTransport]]||[[NXSL:AgentReadList|AgentReadList]]||[[NXSL:FindAlarmById|FindAlarmById]]||[[NXSL:ReadPersistentStorage|ReadPersistentStorage]]||[[NXSL:CopyFile|CopyFile]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:localtime|localtime]]||[[NXSL:sha1|sha1]]||[[NXSL:SNMPGet|SNMPGet]]||[[NXSL:AgentReadParameter|AgentReadParameter]]||[[NXSL:FindAlarmByKey|FindAlarmByKey]]||[[NXSL:WritePersistentStorage|WritePersistentStorage]]||[[NXSL:CreateDirectory|CreateDirectory]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:SecondsToUptime|SecondsToUptime]]||[[NXSL:sha256|sha256]]||[[NXSL:SNMPGetValue|SNMPGetValue]]||[[NXSL:AgentReadTable|AgentReadTable]]||[[NXSL:FindAlarmByKeyRegex|FindAlarmByKeyRegex]]||||[[NXSL:DeleteFile|DeleteFile]]||&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:strftime|strftime]]||||[[NXSL:SNMPSet|SNMPSet]]||||[[NXSL:GetEventParameter|GetEventParameter]]||||[[NXSL:FileAccess|FileAccess]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:time|time]]||||[[NXSL:SNMPWalk|SNMPWalk]]||||[[NXSL:PostEvent|PostEvent]]||||[[NXSL:OpenFile|OpenFile]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NXSL:mktime|mktime]]||||||||[[NXSL:SetEventParameter|SetEventParameter]]||||[[NXSL:RemoveDirectory|RemoveDirectory]]||&lt;br /&gt;
|-&lt;br /&gt;
| ||||||||||||[[NXSL:RenameFile|RenameFile]]||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL_Formal_Grammar&amp;diff=1763</id>
		<title>NXSL Formal Grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL_Formal_Grammar&amp;diff=1763"/>
		<updated>2020-10-05T13:54:01Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
script ::=&lt;br /&gt;
	module |&lt;br /&gt;
	expression&lt;br /&gt;
&lt;br /&gt;
module ::=&lt;br /&gt;
	module_component { module_component }&lt;br /&gt;
&lt;br /&gt;
module_component ::=&lt;br /&gt;
	function |&lt;br /&gt;
	statement_or_block |&lt;br /&gt;
	use_statement&lt;br /&gt;
&lt;br /&gt;
use_statement ::=&lt;br /&gt;
	use any_identifier &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
any_identifier ::=&lt;br /&gt;
	IDENTIFIER |&lt;br /&gt;
	COMPOUND_IDENTFIER&lt;br /&gt;
&lt;br /&gt;
function ::=&lt;br /&gt;
	sub IDENTIFIER &amp;quot;(&amp;quot; [ identifier_list ] &amp;quot;)&amp;quot; block&lt;br /&gt;
&lt;br /&gt;
identifier_list ::=&lt;br /&gt;
	IDENTIFIER { &amp;quot;,&amp;quot; IDENTIFIER }&lt;br /&gt;
&lt;br /&gt;
block ::=&lt;br /&gt;
	&amp;quot;{&amp;quot; { statement_or_block } &amp;quot;}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
statement_or_block ::=&lt;br /&gt;
	statement |&lt;br /&gt;
	block&lt;br /&gt;
&lt;br /&gt;
statement ::=&lt;br /&gt;
	expression &amp;quot;;&amp;quot; |&lt;br /&gt;
	builtin_statement |&lt;br /&gt;
	&amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
builtin_statement ::=&lt;br /&gt;
	simple_statement &amp;quot;;&amp;quot; |&lt;br /&gt;
	if_statement |&lt;br /&gt;
	do_statement |&lt;br /&gt;
	while_statement |&lt;br /&gt;
	for_statement |&lt;br /&gt;
	foreach_statement |&lt;br /&gt;
	switch_statement |&lt;br /&gt;
	array_statement |&lt;br /&gt;
	global_statement |&lt;br /&gt;
	break &amp;quot;;&amp;quot;&lt;br /&gt;
	continue &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
simple_statement ::=&lt;br /&gt;
	keyword [ expression ]&lt;br /&gt;
&lt;br /&gt;
keyword ::=&lt;br /&gt;
	exit |&lt;br /&gt;
	print |&lt;br /&gt;
	println |&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
if_statement ::=&lt;br /&gt;
	if &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block [ else statement_or_block ]&lt;br /&gt;
&lt;br /&gt;
for_statement ::=&lt;br /&gt;
	for &amp;quot;(&amp;quot; expression &amp;quot;;&amp;quot; expression &amp;quot;;&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
foreach_statement ::=&lt;br /&gt;
	foreach &amp;quot;(&amp;quot; IDENTIFIER &amp;quot;:&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
while_statement ::=&lt;br /&gt;
	while &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; statement_or_block&lt;br /&gt;
&lt;br /&gt;
do_statement ::=&lt;br /&gt;
	do statement_or_block while &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
switch_statement ::=&lt;br /&gt;
	switch &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; &amp;quot;{&amp;quot; case { case } [ default ] &amp;quot;}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case ::=&lt;br /&gt;
	case constant &amp;quot;:&amp;quot; { statement_or_block }&lt;br /&gt;
&lt;br /&gt;
default ::=&lt;br /&gt;
	default &amp;quot;:&amp;quot; { statement_or_block }&lt;br /&gt;
&lt;br /&gt;
array_statement ::=&lt;br /&gt;
	[ global ] array identifier_list &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
global_statement ::=&lt;br /&gt;
	global global_variable_declaration { &amp;quot;,&amp;quot; global_variable_declaration } &amp;quot;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
global_variable_declaration ::=&lt;br /&gt;
	IDENTIFIER [ &amp;quot;=&amp;quot; expression ]&lt;br /&gt;
&lt;br /&gt;
expression ::=&lt;br /&gt;
	&amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot; |&lt;br /&gt;
	IDENTIFIER &amp;quot;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;-&amp;gt;&amp;quot; IDENTIFIER |&lt;br /&gt;
	&amp;quot;-&amp;quot; expression |&lt;br /&gt;
	&amp;quot;!&amp;quot; expression |&lt;br /&gt;
	&amp;quot;~&amp;quot; expression |&lt;br /&gt;
	inc IDENTIFIER |&lt;br /&gt;
	dec IDENTIFIER |&lt;br /&gt;
	IDENTIFIER inc |&lt;br /&gt;
	IDENTIFIER dec |&lt;br /&gt;
	expression &amp;quot;+&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;-&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;*&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;/&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;%&amp;quot; expression |&lt;br /&gt;
	expression like expression |&lt;br /&gt;
	expression ilike expression |&lt;br /&gt;
	expression &amp;quot;~=&amp;quot; expression |&lt;br /&gt;
	expression match expression |&lt;br /&gt;
	expression imatch expression |&lt;br /&gt;
	expression &amp;quot;==&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;!=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;=&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;amp;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;|&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;^&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;amp;&amp;amp;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;||&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;lt;&amp;lt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;&amp;gt;&amp;gt;&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;.&amp;quot; expression |&lt;br /&gt;
	expression &amp;quot;?&amp;quot; expression &amp;quot;:&amp;quot; expression |&lt;br /&gt;
	operand&lt;br /&gt;
&lt;br /&gt;
operand ::=&lt;br /&gt;
	function_call |&lt;br /&gt;
	type_cast |&lt;br /&gt;
	constant |&lt;br /&gt;
	IDENTIFIER&lt;br /&gt;
&lt;br /&gt;
type_cast ::=&lt;br /&gt;
	builtin_type &amp;quot;(&amp;quot; expression &amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
builtin_type ::=&lt;br /&gt;
	int32 |&lt;br /&gt;
	int64 |&lt;br /&gt;
	uint32 |&lt;br /&gt;
	uint64 |&lt;br /&gt;
	real |&lt;br /&gt;
	string&lt;br /&gt;
&lt;br /&gt;
function_call ::=&lt;br /&gt;
	IDENTIFIER &amp;quot;(&amp;quot; [ expression { &amp;quot;,&amp;quot; expression } ] &amp;quot;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
constant ::=&lt;br /&gt;
	STRING |&lt;br /&gt;
	INT32 |&lt;br /&gt;
	INT64 |&lt;br /&gt;
	UINT32 |&lt;br /&gt;
	UINT64 |&lt;br /&gt;
	REAL |&lt;br /&gt;
	NULL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Terminal symbols&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IDENTIFIER ::= [A-Za-z_\$][A-Za-z_\$0-9]*&lt;br /&gt;
COMPOUND_IDENTIFIER ::= { IDENTIFIER}(::{ IDENTIFIER})+&lt;br /&gt;
INTEGER ::= \-?(0x)?[0-9]+&lt;br /&gt;
INT32 ::= INTEGER&lt;br /&gt;
INT64 ::= {INTEGER}L&lt;br /&gt;
UINT32 ::= {INTEGER}U&lt;br /&gt;
UINT64 ::= {INTEGER}(UL|LU)&lt;br /&gt;
REAL ::= \-?[0-9]+\.[0-9]+&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Setting_node_geolocation_from_SNMP&amp;diff=1762</id>
		<title>Script Example: Setting node geolocation from SNMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Setting_node_geolocation_from_SNMP&amp;diff=1762"/>
		<updated>2020-10-05T13:53:42Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adjust the OIDs in &amp;#039;&amp;#039;SNMPGetValue&amp;#039;&amp;#039; as required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
transport = CreateSNMPTransport($node);&lt;br /&gt;
if (transport == null) {&lt;br /&gt;
  return null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
lat = SNMPGetValue(transport, &amp;quot;.1.2.3.4.1&amp;quot;);&lt;br /&gt;
lon = SNMPGetValue(transport, &amp;quot;.1.2.3.4.2&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (lat == null || lon == null) {&lt;br /&gt;
  return null;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
geoLoc = new GeoLocation(lat, lon);&lt;br /&gt;
$node-&amp;gt;setGeoLocation(geoLoc);&lt;br /&gt;
&lt;br /&gt;
return 0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Recursively_Collect_Values_from_Custom_Attributes&amp;diff=1761</id>
		<title>Script Example: Recursively Collect Values from Custom Attributes</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Recursively_Collect_Values_from_Custom_Attributes&amp;diff=1761"/>
		<updated>2020-10-05T13:53:29Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script recursively collects values of custom attribute &amp;#039;&amp;#039;&amp;#039;contacts&amp;#039;&amp;#039;&amp;#039; from all node parents. Collected values concatenated into single string and separated by semicolons. Duplicate values added only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
global contacts = &amp;quot;&amp;quot;;  // concatenated values will be stored here&lt;br /&gt;
global presence = %{ };  // value presence indicator (hash map)&lt;br /&gt;
&lt;br /&gt;
// walk through each parent object for current node&lt;br /&gt;
foreach(o : GetObjectParents($node))&lt;br /&gt;
{&lt;br /&gt;
	add_contacts(o);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Concatenated result is in &amp;quot;contacts&amp;quot; global variable&lt;br /&gt;
println &amp;quot;Contacts: &amp;quot; . contacts;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Recursively add contacts from object and it&amp;#039;s parents&lt;br /&gt;
 */&lt;br /&gt;
sub add_contacts(curr)&lt;br /&gt;
{&lt;br /&gt;
	c = GetCustomAttribute(curr, &amp;quot;contacts&amp;quot;);&lt;br /&gt;
	if ((c != null) &amp;amp;&amp;amp; (presence[c] == null))&lt;br /&gt;
	{&lt;br /&gt;
		if (length(contacts) &amp;gt; 0)&lt;br /&gt;
			contacts = contacts . &amp;quot;;&amp;quot; . c;&lt;br /&gt;
		else&lt;br /&gt;
			contacts = c;&lt;br /&gt;
		presence[c] = true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	foreach(o : GetObjectParents(curr))&lt;br /&gt;
	{&lt;br /&gt;
		add_contacts(o);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Read_Table_From_Agent&amp;diff=1760</id>
		<title>Script Example: Read Table From Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Read_Table_From_Agent&amp;diff=1760"/>
		<updated>2020-10-05T13:53:05Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script can be put into Script Library and run from server&amp;#039;s debug console. It accepts node object name or ID as first parameter, table name as second parameter, and prints content of given table to console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// Find node object&lt;br /&gt;
node = FindObject($1);&lt;br /&gt;
if (node == null)&lt;br /&gt;
{&lt;br /&gt;
	println &amp;quot;ERROR: Node not found&amp;quot;;&lt;br /&gt;
	return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// REad table data from agent&lt;br /&gt;
table = AgentReadTable(node, $2);&lt;br /&gt;
if (table == null)&lt;br /&gt;
{&lt;br /&gt;
	println &amp;quot;ERROR: Cannot read table from agent&amp;quot;;&lt;br /&gt;
	return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Print column names&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;columnCount; i++)&lt;br /&gt;
	print &amp;quot;| &amp;quot; . left(table-&amp;gt;getColumnName(i), 20);&lt;br /&gt;
println &amp;quot;|&amp;quot;;&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;columnCount; i++)&lt;br /&gt;
	print &amp;quot;+&amp;quot; . left(&amp;quot;-&amp;quot;, 21, &amp;quot;-&amp;quot;);&lt;br /&gt;
println &amp;quot;+&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Print data&lt;br /&gt;
for(i = 0; i &amp;lt; table-&amp;gt;rowCount; i++)&lt;br /&gt;
{&lt;br /&gt;
	for(j = 0; j &amp;lt; table-&amp;gt;columnCount; j++)&lt;br /&gt;
	{&lt;br /&gt;
		print &amp;quot;| &amp;quot; . left(table-&amp;gt;get(i, j), 20);&lt;br /&gt;
	}&lt;br /&gt;
	println &amp;quot;|&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Read_SNMP_Value_From_Node&amp;diff=1759</id>
		<title>Script Example: Read SNMP Value From Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Read_SNMP_Value_From_Node&amp;diff=1759"/>
		<updated>2020-10-05T13:52:51Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script can be put into Script Library and run from server&amp;#039;s debug console. It accepts node object name or ID as parameter and prints value of SNMP sysDescription to console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
if ($1 == null)&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Please specify node name as parameter&amp;quot;;&lt;br /&gt;
   return 3;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
transport = CreateSNMPTransport(FindObject($1));    // Create SNMP transport for node&lt;br /&gt;
if (transport == null)&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;Failed to create SNMP transport, exit&amp;quot;;&lt;br /&gt;
    return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
value = SNMPGetValue(transport, &amp;quot;.1.3.6.1.2.1.1.1.0&amp;quot;);&lt;br /&gt;
if (value == null)&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;Failed to issue SNMP GET request&amp;quot;;&lt;br /&gt;
    return 2;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    println &amp;quot;System description: &amp;quot; . value;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of script output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\Source\NetXMS\x64\debug&amp;gt;nxadm -c &amp;quot;exec GetSysDescr cisco-2600-central&amp;quot;&lt;br /&gt;
System description: Cisco IOS Software, C2600 Software (C2600-ADVSECURITYK9-M), Version 12.4(1a), RELEASE SOFTWARE (fc2)&lt;br /&gt;
Technical Support: http://www.cisco.com/techsupport&lt;br /&gt;
Copyright (c) 1986-2005 by Cisco Systems, Inc.&lt;br /&gt;
Compiled Fri 27-May-05 15:09 by hqluong&lt;br /&gt;
INFO: Script finished with rc=0&lt;br /&gt;
&lt;br /&gt;
C:\Source\NetXMS\x64\debug&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Aggregation_of_DCI_values_and_applying_the_95%25_percentile_average&amp;diff=1758</id>
		<title>Script Example: Aggregation of DCI values and applying the 95% percentile average</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Aggregation_of_DCI_values_and_applying_the_95%25_percentile_average&amp;diff=1758"/>
		<updated>2020-10-05T13:52:34Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The example is based around a template which configures ICMP Packet Loss probes. This script will loop around the nodes, collect the required DCI values. The values are then ordered and the top 5 percent discarded, the remaining entries are averaged to give the required value;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
trace(1, &amp;quot;Global Ping Loss 95&amp;quot;);&lt;br /&gt;
array pValue;&lt;br /&gt;
arrayI  = 0;&lt;br /&gt;
&lt;br /&gt;
foreach(parent : GetNodeParents($node))&lt;br /&gt;
{&lt;br /&gt;
	trace(3, &amp;quot;Parent object: name=&amp;#039;&amp;quot; . parent-&amp;gt;name .&amp;quot;&amp;#039; id=&amp;quot; . parent-&amp;gt;id);&lt;br /&gt;
	if (parent-&amp;gt;name == &amp;quot;all voice&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		foreach(vNode : GetObjectChildren(parent))&lt;br /&gt;
		{&lt;br /&gt;
			dciName = &amp;quot;ICMP: Packet loss to &amp;quot;.vNode-&amp;gt;name;&lt;br /&gt;
			dciId = FindDCIByDescription(vNode, dciName);&lt;br /&gt;
			if (dciId &amp;gt; 0)&lt;br /&gt;
			{&lt;br /&gt;
				tmpValue = GetDCIValue(vNode,dciId);				&lt;br /&gt;
				if (tmpValue != null)&lt;br /&gt;
				{&lt;br /&gt;
					pValue[arrayI++] = tmpValue;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Sort the Array&lt;br /&gt;
bubbleSort(pValue);&lt;br /&gt;
&lt;br /&gt;
// Apply the 95 percent rule&lt;br /&gt;
upTo = arrayI * 0.95;&lt;br /&gt;
pLoss = 0;&lt;br /&gt;
pCount = 0;&lt;br /&gt;
for(ia = 0; ia &amp;lt; upTo; ia++)&lt;br /&gt;
{&lt;br /&gt;
	pLoss += pValue[ia];&lt;br /&gt;
	pCount = ia;&lt;br /&gt;
}&lt;br /&gt;
p95AvgLoss = pLoss / pCount;&lt;br /&gt;
&lt;br /&gt;
trace(1, &amp;quot;Global Ping Loss 95 Summary: arrayI=&amp;quot;.arrayI.&amp;quot; upTo=&amp;quot;.upTo.&amp;quot; p95AvgLoss=&amp;quot;.p95AvgLoss );&lt;br /&gt;
&lt;br /&gt;
return p95AvgLoss;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub bubbleSort(arr)&lt;br /&gt;
{&lt;br /&gt;
	swapped = true;&lt;br /&gt;
	while (swapped == true){&lt;br /&gt;
		swapped = false;&lt;br /&gt;
		for(ia = 1; arr[ia] != null; ia++)&lt;br /&gt;
		{&lt;br /&gt;
			ib = ia - 1;&lt;br /&gt;
			&lt;br /&gt;
			if (arr[ib] &amp;gt; arr[ia]){&lt;br /&gt;
				trace(3,&amp;quot;swap: &amp;quot;.ib.&amp;quot;:&amp;quot;.arr[ib].&amp;quot; with &amp;quot;.ia.&amp;quot;:&amp;quot;.arr[ia]);&lt;br /&gt;
				swapped=true;&lt;br /&gt;
				t = arr[ib];&lt;br /&gt;
				arr[ib] = arr[ia];&lt;br /&gt;
				arr[ia] = t;&lt;br /&gt;
				swapped = true;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub printArray(arr)&lt;br /&gt;
{&lt;br /&gt;
	for(ia = 0; arr[ia] != null; ia++)&lt;br /&gt;
	{&lt;br /&gt;
		trace(1,&amp;quot;printArray: &amp;quot;.ia.&amp;quot;:&amp;quot;.arr[ia]);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Custom_Attributes_for_Node&amp;diff=1757</id>
		<title>Script Example: Enumerate All Custom Attributes for Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Custom_Attributes_for_Node&amp;diff=1757"/>
		<updated>2020-10-05T13:52:13Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Enumerate all custom attributes on a node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note: this script requires NetXMS version 2.0.2 or higher.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
attributes = $node-&amp;gt;customAttributes;&lt;br /&gt;
foreach(a : attributes-&amp;gt;keys)&lt;br /&gt;
{&lt;br /&gt;
        println a . &amp;quot;=&amp;quot; . attributes[a];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Nodes&amp;diff=1756</id>
		<title>Script Example: Enumerate All Nodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Enumerate_All_Nodes&amp;diff=1756"/>
		<updated>2020-10-05T13:51:58Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Enumerate all nodes in NetXMS database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Create script in script library which will find &amp;quot;Entire Networks&amp;quot; object and walk down the tree. This script can be executes as an action from event processing policy, or directly from server debug console via &amp;#039;&amp;#039;&amp;#039;exec&amp;#039;&amp;#039;&amp;#039; command.&lt;br /&gt;
&lt;br /&gt;
In order to be able to access info about all nodes, the &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039; server configuration variable needs to be set to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// Find &amp;quot;Entire Network&amp;quot; object and start enumeration from it&lt;br /&gt;
EnumerateNodes(FindObject(1));&lt;br /&gt;
&lt;br /&gt;
// This function walks object tree recursively starting from given root&lt;br /&gt;
sub EnumerateNodes(rootObject)&lt;br /&gt;
{&lt;br /&gt;
	// Walk all child objects&lt;br /&gt;
	foreach(o : GetObjectChildren(rootObject))&lt;br /&gt;
	{&lt;br /&gt;
		if (classof(o) == &amp;quot;Node&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			// Process node object&lt;br /&gt;
			trace(1, &amp;quot;  + &amp;quot; . o-&amp;gt;name);&lt;br /&gt;
		}&lt;br /&gt;
		else if (classof(o) == &amp;quot;NetObj&amp;quot;)&lt;br /&gt;
		{&lt;br /&gt;
			// For all other objects, go down the tree&lt;br /&gt;
			// There can be additional checks for object class, like&lt;br /&gt;
			// if (o-&amp;gt;type == 5)&lt;br /&gt;
			EnumerateNodes(o);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Script_Example:_Additional_Information_About_Connected_Node&amp;diff=1755</id>
		<title>Script Example: Additional Information About Connected Node</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Script_Example:_Additional_Information_About_Connected_Node&amp;diff=1755"/>
		<updated>2020-10-05T13:51:48Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Add information about name, IP address, and MAC address about connected node to notification about switch port being down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Use named event attribute &amp;#039;&amp;#039;additionalInfo&amp;#039;&amp;#039; to pass information into e-mail body (using %&amp;lt;additionalInfo&amp;gt; macro). To populate this attribute the following script can be used:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// only for interface up and down events&lt;br /&gt;
if (($event-&amp;gt;name != &amp;quot;SYS_IF_DOWN&amp;quot;) &amp;amp;&amp;amp; ($event-&amp;gt;name != &amp;quot;SYS_IF_UP&amp;quot;))&lt;br /&gt;
	return true;&lt;br /&gt;
	&lt;br /&gt;
// get interface object from interface index&lt;br /&gt;
iface = GetInterfaceObject($node, $5);&lt;br /&gt;
if (iface == null)&lt;br /&gt;
	return true;&lt;br /&gt;
&lt;br /&gt;
// get peer node (node connected to this interface) object&lt;br /&gt;
peer = iface-&amp;gt;peerNode;&lt;br /&gt;
if (peer == null)&lt;br /&gt;
	return true;&lt;br /&gt;
	&lt;br /&gt;
// get peer interface object (needed to obtain MAC address)&lt;br /&gt;
peerIface = iface-&amp;gt;peerInterface;&lt;br /&gt;
if (peerIface != null)&lt;br /&gt;
{&lt;br /&gt;
	macAddr = peerIface-&amp;gt;macAddr;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
	macAddr = &amp;quot;&amp;lt;MAC unknown&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// set event&amp;#039;s named parameter	&lt;br /&gt;
SetEventParameter($event, &amp;quot;additionalInfo&amp;quot;,&lt;br /&gt;
	&amp;quot;Peer: &amp;quot; . peer-&amp;gt;name . &amp;quot; &amp;quot; . peer-&amp;gt;ipAddr . &amp;quot; &amp;quot; . macAddr);&lt;br /&gt;
&lt;br /&gt;
return true;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Script_Examples&amp;diff=1754</id>
		<title>SG:Script Examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Script_Examples&amp;diff=1754"/>
		<updated>2020-10-05T13:51:34Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Additional Information About Connected Node|Additional Information About Connected Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Enumerate All Nodes|Enumerate All Nodes]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Enumerate All Custom Attributes for Node|Enumerate All Custom Attributes for Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Aggregation of DCI values and applying the 95% percentile average|Aggregation of DCI values and applying the 95% percentile average]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Read SNMP Value From Node|Read SNMP Value From Node]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Read Table From Agent|Read Table From Agent]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Recursively Collect Values from Custom Attributes|Recursively Collect Values from Custom Attributes]]&lt;br /&gt;
&lt;br /&gt;
[[Script Example: Setting node geolocation from SNMP|Setting node geolocation from SNMP]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Security_Issues&amp;diff=1753</id>
		<title>SG:Security Issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Security_Issues&amp;diff=1753"/>
		<updated>2020-10-05T13:51:20Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Security Issues}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because NXSL provides functions for searching objects, and because all scripts are executed on management server, user with write access to only one node can potentially acquire information about nodes to which he normally does not have access. For example, without additional security checks user with write access to node A and no access to node B can create transformation script for DCI on node A and use [[NXSL:FindNodeObject|FindNodeObject]] function to access node B and get information about it, thus breaking security settings.&lt;br /&gt;
&lt;br /&gt;
To prevent such scenario, all NXSL functions capable of accessing NetXMS objects requires &amp;quot;current node&amp;quot; object to be provided. Reference to object being searched will only be returned if node object supplied as &amp;quot;current node&amp;quot; is in trusted nodes list of target object. For example, if variable &amp;#039;&amp;#039;&amp;#039;$node&amp;#039;&amp;#039;&amp;#039; in script refers to NODE1, and [[NXSL:FindNodeObject|FindNodeObject]]($node, &amp;quot;NODE2&amp;quot;) called, NODE1 must be added to list of trusted nodes for NODE2. In most places (transformation script, event processing policy, etc.) predefined variable &amp;#039;&amp;#039;&amp;#039;$node&amp;#039;&amp;#039;&amp;#039; exists, which refers to node object on behalf of which script is being executed. It will be event source for event processing policy script, DCI owner for transformation script, and so on.&lt;br /&gt;
&lt;br /&gt;
For environments where such strict security checks are not required (for example, all users have read access to all nodes), they can be disabled to simplify configuration. Enforcement of trusted nodes checking controlled by server&amp;#039;s configuration variable &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039;. By default it is set to &amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039; and check of trusted nodes is not enforced. To enable it, server&amp;#039;s configuration variable &amp;#039;&amp;#039;&amp;#039;CheckTrustedNodes&amp;#039;&amp;#039;&amp;#039; must be set to &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;. The server restart is required to make this change effective.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=UM:NetXMS_Scripting_Language_(NXSL)&amp;diff=1752</id>
		<title>UM:NetXMS Scripting Language (NXSL)</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=UM:NetXMS_Scripting_Language_(NXSL)&amp;diff=1752"/>
		<updated>2020-10-05T13:51:05Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:NetXMS Scripting Language (NXSL)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= NXSL Overview =&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Hello, World!&amp;quot; Program =&lt;br /&gt;
Syntactically, NXSL looks similar to Perl or C. Here&amp;#039;s simple NXSL program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program will print word &amp;#039;&amp;#039;Hello&amp;#039;&amp;#039; on screen.&lt;br /&gt;
&lt;br /&gt;
Also, keep in mind that you are free to choose your own formatting style. E.g. the above could have been written as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */ sub main(){println &amp;quot;Hello!&amp;quot;;return 0;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&amp;#039;ll analyze this program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* sample program */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Everything inside /* */ is considered a comment and will be ignored by interpreter. You can enclose comments, like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* comment /* another comment */ still comment */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use single line comments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
x = 1; // everything between two slashes and end of line is a comment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now onto next line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub main()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a function definition. A function is a part of a program that can be called by other parts of the program. A function definition always has the following form: &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;parameters&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{&lt;br /&gt;
   /* the function code goes here */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The function can return a value to the caller and accept zero or more parameters.&lt;br /&gt;
&lt;br /&gt;
The function name follows the rules for all names (formally: identifiers): it must consist entirely of letters (uppercase and lowercase are different!), digits, underscores (_) and dollar signs ($), but may not begin with a digit. Please note that most special identifiers starts with dollar sign ($), so it is recommended not to start your identifiers with it.&lt;br /&gt;
&lt;br /&gt;
First line in function code looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this line, println is an embedded operator which prints given string to standard output with carriage return, and &amp;quot;Hello!&amp;quot; is a string we want to print. Please note semicolon at the end of line – it&amp;#039;s a separator between operators. Each operator should end with semicolon.&lt;br /&gt;
&lt;br /&gt;
The next, and final, line of our small program is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
return 0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return is another built-in operator which exits the function and sets it&amp;#039;s return value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Script entry point =&lt;br /&gt;
NXSL handles script entry in 2 ways:&amp;lt;br&amp;gt;&lt;br /&gt;
* Explicit main() function&lt;br /&gt;
* Implicit $main() fucntion&lt;br /&gt;
&lt;br /&gt;
If an explicitelly defined main() exists, it will be called.&lt;br /&gt;
&lt;br /&gt;
If an explicit main() doesnt exist, an implicit $main() fucntion will be created by the script interpreter and the script will enter at the $main() function.&amp;lt;br&amp;gt;&lt;br /&gt;
The $main() fucntion is constructed from code that is not a part of any other functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types =&lt;br /&gt;
NXSL is loose typed programming language. The system will automatically determine each variable type, assign a certain type to a variable and convert a variable type from one to another, if necessary. For example, a result for &amp;lt;tt&amp;gt;3 + &amp;quot;4&amp;quot;&amp;lt;/tt&amp;gt; will be 7, because the system will automatically convert &amp;lt;tt&amp;gt;&amp;quot;4&amp;quot;&amp;lt;/tt&amp;gt; string into an integer. In case if the system is not able to automatically convert a line into an appropriate integer, the operation will result in a runtime error.&lt;br /&gt;
&lt;br /&gt;
NXSL supports the following variable types:&lt;br /&gt;
&lt;br /&gt;
* integer (32 bit),&lt;br /&gt;
* unsigned integer (32 bit), &lt;br /&gt;
* integer (64 bit), unsigned integer (64 bit), &lt;br /&gt;
* floating-point number, &lt;br /&gt;
* string,&lt;br /&gt;
* array,&lt;br /&gt;
* object.&lt;br /&gt;
&lt;br /&gt;
In addition to that, NXSL also supports a special variable type – NULL. This value represents a variable with no value. NULL is the only possible value of type NULL. An attempt to perform any type of arithmetical or string operations with NULL variable will result in system runtime error.&lt;br /&gt;
&lt;br /&gt;
It is possible to manually convert variable to a certain type, using a special function, named depending on the variable type. For example, &amp;lt;tt&amp;gt;string(4)&amp;lt;/tt&amp;gt;. That way it is also possible to convert NULL type variables. Therefore, to avoid runtime errors while processing NULL type variables, it is advised to use manual conversion.&lt;br /&gt;
&lt;br /&gt;
NXSL does not require setting variable type beforehand. The only exception to this is arrays. In case if an array is required, operator &amp;lt;tt&amp;gt;array &amp;lt;/tt&amp;gt;defines its subsequent variables as arrays. Accessing variable which was not previously assigned will return NULL value.&lt;br /&gt;
&lt;br /&gt;
Although NXSL has object type variables, it is not an object-oriented language. It is not possible to define classes or create objects at script level – only in extensions written in C++. Object type variables are used to return information about complex NetXMS objects, like nodes or events, in a convenient way. Please note that assigning object type variables actually holds reference to an object, so assigning object value to another variable does not duplicate actual object, but just copy reference to it.&lt;br /&gt;
&lt;br /&gt;
To get a human-readable representation of a variable or expression type for debugging, use the &amp;lt;tt&amp;gt;typeof()&amp;lt;/tt&amp;gt; function, and to get a class name for object type variables, use &amp;lt;tt&amp;gt;classof()&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
Variables in NXSL behave the same way as variables in most popular programming languages (C, C++, etc.) do, but in NXSL you don&amp;#039;t have to declare variables before you use them. &lt;br /&gt;
&lt;br /&gt;
Scope of a variable can be either global (visible in any function in the script) or local (visible only in the function within which it was defined). Any variable is by default limited to the local function scope. Variable can be declared global using &amp;#039;&amp;#039;&amp;#039;global&amp;#039;&amp;#039;&amp;#039; operator.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
x = 1;&lt;br /&gt;
myFunction();&lt;br /&gt;
&lt;br /&gt;
sub myFunction()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;x=&amp;quot; . x;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script will cause run time error &amp;quot;Error 5 in line 6: Invalid operation with NULL value&amp;quot;, because variable &amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039; is local (in implicit main function) and is not visible in function &amp;#039;&amp;#039;&amp;#039;myFunction&amp;#039;&amp;#039;&amp;#039;. The following script will produce expected result (prints x=1):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
global x = 1;&lt;br /&gt;
myFunction();&lt;br /&gt;
&lt;br /&gt;
sub myFunction()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;x=&amp;quot; . x;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
A function is a named code block that is generally intended to process specified input values into an output value, although this is not always the case. For example, the [[NXSL:trace|trace]] function takes variables and static text and prints the values into server log. Like many languages, NXSL provides for user-defined functions. These may be located anywhere in the main program or loaded in from other scripts via the use keywords.&lt;br /&gt;
To define a function, you can use the following form:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;ARGUMENTS&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;BLOCK&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; is any valid identifier, &amp;#039;&amp;#039;ARGUMENTS&amp;#039;&amp;#039; is optional list of argument names, and &amp;#039;&amp;#039;BLOCK&amp;#039;&amp;#039; is code block.&lt;br /&gt;
&lt;br /&gt;
To call a function you would use the following form:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;LIST&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;NAME&amp;#039;&amp;#039; is identifier used in function definition, and &amp;#039;&amp;#039;LIST&amp;#039;&amp;#039; is an optional list of expressions passed as function arguments.&lt;br /&gt;
&lt;br /&gt;
To give a quick example of a simple subroutine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub message()&lt;br /&gt;
{&lt;br /&gt;
   println &amp;quot;Hello!&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function Arguments ==&lt;br /&gt;
&lt;br /&gt;
The first argument you pass to the function is available within the function as $1, the second argument is $2, and so on. For example, this simple function adds two numbers and prints the result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub add()&lt;br /&gt;
{&lt;br /&gt;
   result = $1 + $2;&lt;br /&gt;
   println &amp;quot;The result was: &amp;quot; . result;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To call the subroutine and get a result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
add(1, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want named arguments, list of aliases for $1, $2, etc. can be provided in function declaration inside the brackets:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub add(numberA, numberB)&lt;br /&gt;
{&lt;br /&gt;
   result = numberA + numberB;&lt;br /&gt;
   println &amp;quot;The result was: &amp;quot; . result;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If parameter was not provided at function call, value of appropriate variable will be &amp;#039;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Return Values from a Function ==&lt;br /&gt;
&lt;br /&gt;
You can return a value from a function using the &amp;#039;&amp;#039;&amp;#039;return&amp;#039;&amp;#039;&amp;#039; keyword:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub pct(value, total)&lt;br /&gt;
{&lt;br /&gt;
   return value / total * 100.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When called, return immediately terminates the current function and returns the value to the caller. If you don&amp;#039;t specify a value in &amp;#039;&amp;#039;&amp;#039;return&amp;#039;&amp;#039;&amp;#039; statement or function ends implicitly by reaching end of function&amp;#039;s block, then the return value is &amp;#039;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Arrays =&lt;br /&gt;
An array in NXSL is actually an ordered map. A map is a type that associates &amp;#039;&amp;#039;values&amp;#039;&amp;#039; to &amp;#039;&amp;#039;keys&amp;#039;&amp;#039;. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays. &lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;key&amp;#039;&amp;#039; must be a non-negative integer. When an array is created, its size is not specified and its map can have empty spots in it. For example, an array can have a element with a &amp;#039;&amp;#039;0&amp;#039;&amp;#039; key and an element with &amp;#039;&amp;#039;4&amp;#039;&amp;#039; key and no keys in-between. Attempting to access an array key which has not been defined is the same as accessing any other undefined variable: the result will be &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Array elements can be accessed using [&amp;#039;&amp;#039;index&amp;#039;&amp;#039;] operator. For example, to access element with index 3 of array &amp;#039;&amp;#039;a&amp;#039;&amp;#039; you should use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
a[3];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Array Initialization ==&lt;br /&gt;
&lt;br /&gt;
New array can be created in two ways. First is to use &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039; operator. &amp;lt;br&amp;gt;&lt;br /&gt;
This statement will create empty array and assign reference to it to variable &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
array a;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can then assign values to the array like this.&amp;lt;br&amp;gt;&lt;br /&gt;
Please note arrays in NXSL are sparse, so you can have elements with nothing in between.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
array a;&lt;br /&gt;
&lt;br /&gt;
a[1] = 1;&lt;br /&gt;
a[2] = 2;&lt;br /&gt;
a[260] = 260;&lt;br /&gt;
&lt;br /&gt;
println(a[1]); // will print 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second way is to use %( ) construct to create array already populated with values.&amp;lt;br&amp;gt;&lt;br /&gt;
This statement will create array with four elements at positions 0, 1, 2, and 3, and assign reference to this array to variable &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// no need to use &amp;quot;array a;&amp;quot; here, since we are creating it dirrectly&lt;br /&gt;
a = %(1, 2, 3, 4);&lt;br /&gt;
&lt;br /&gt;
println(a[0]); // will actually print 1, since 1 is the 0th member&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Array initialization can also be used directly in expressions, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
sub f()&lt;br /&gt;
{&lt;br /&gt;
   return %(2, &amp;quot;text&amp;quot;, %(1, 2, 3));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example function &amp;#039;&amp;#039;f&amp;#039;&amp;#039; returns array of 3 elements - number, text, and another array of 3 numeric elements.&lt;br /&gt;
&lt;br /&gt;
= Operators =&lt;br /&gt;
An operator is something that you feed with one or more values, which yields another value.&lt;br /&gt;
&lt;br /&gt;
== Arithmetic Operators ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Example !! Name !! Result&lt;br /&gt;
|-&lt;br /&gt;
| -a || Negation || Opposite of &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a + b || Addition || Sum of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a - b || Subtraction || Difference of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a * b || Multiplication || Product of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a / b || Division || Quotient of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| a % b || Modulus || Remainder of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; divided by &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
The division operator (&amp;quot;/&amp;quot;) returns a float value unless the two operands are integers (or strings that get converted to integers) and the numbers are evenly divisible, in which case an integer value will be returned. &lt;br /&gt;
&lt;br /&gt;
Calling modulus on float operands will yield runtime error. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assignment Operator ==&lt;br /&gt;
The assignment operator is &amp;quot;=&amp;quot;, which means that the left operand gets set to the value of the expression on the rights (that is, &amp;quot;gets set to&amp;quot;). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bitwise Operators ==&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ~ a &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in &amp;#039;&amp;#039;a&amp;#039;&amp;#039; are not set, and vice versa. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;amp; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| And&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in both operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a | b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Or&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in either operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a ^ b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Xor&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Bits that are set in only one operand are set.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt;&amp;lt; b&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift left&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift the bits of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; &amp;#039;&amp;#039;b&amp;#039;&amp;#039; steps to the left (each step means &amp;quot;multiply by two&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt;&amp;gt; b &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift right&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Shift the bits of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; &amp;#039;&amp;#039;b&amp;#039;&amp;#039; steps to the right (each step means &amp;quot;divide by two&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Comparison Operators ==&lt;br /&gt;
Comparison operators allow you to compare two values. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Table 3: Comparison Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a == b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Equal&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a != b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not equal&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is not equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt; b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Less than&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is strictly less than &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Greater than&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is strictly greater than &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;nowiki&amp;gt;a &amp;lt;= b&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Less than or equal to &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is less than or equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;gt;= b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Greater than or equal to &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is greater than or equal to &amp;#039;&amp;#039;b&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a ~= b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039;. As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a match b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039;. As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a imatch b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Match (case insensitive)&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is matched to regular expression &amp;#039;&amp;#039;b&amp;#039;&amp;#039; (case insensitive). As a side effect, assigns values to special variables $1, $2, $3, etc. See &amp;#039;&amp;#039;Regular Expressions&amp;#039;&amp;#039; for details.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Incrementing/Decrementing Operators ==&lt;br /&gt;
NXSL supports C-style pre- and post-increment and decrement operators. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Table 4: Incrementing/Decrementing Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Effect&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ++a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Pre-increment&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Increments &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one, then returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a++&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Post-increment&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, then increments &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| --a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Pre-decrement&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Decrements &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one, then returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a--&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Post-decrement&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Returns &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, then decrements &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by one.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
== Logical Operators ==&lt;br /&gt;
&amp;#039;&amp;#039;Table 5: Logical Operators&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Example&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Name&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Result&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| ! a&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Not&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is not &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;amp;&amp;amp; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| And&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if both &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;b&amp;#039;&amp;#039; is &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| a &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; b&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:none;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| Or&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.0007in solid #000000;border-left:0.0007in solid #000000;border-right:0.0007in solid #000000;padding-top:0.0236in;padding-bottom:0.0236in;padding-left:0.075in;padding-right:0.075in;&amp;quot;| &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; if either &amp;#039;&amp;#039;a&amp;#039;&amp;#039; or &amp;#039;&amp;#039;b&amp;#039;&amp;#039; is &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== String Operators ==&lt;br /&gt;
There are two string operators. The first is the concatenation operator (&amp;#039;.&amp;#039;), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator (&amp;#039;&amp;#039;&amp;#039;.=&amp;#039;&amp;#039;&amp;#039;), which appends the argument on the right side to the argument on the left side.&lt;br /&gt;
&lt;br /&gt;
= Control structures =&lt;br /&gt;
Any NXSL script is built out of a series of statements. A statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing (an empty statement). Statements usually end with a semicolon. In addition, statements can be grouped into a statement-group by encapsulating a group of statements with curly braces. A statement-group is a statement by itself as well. The various statement types are supported: &lt;br /&gt;
&lt;br /&gt;
* if&lt;br /&gt;
&lt;br /&gt;
* else&lt;br /&gt;
* while&lt;br /&gt;
* do-while&lt;br /&gt;
* for&lt;br /&gt;
* break&lt;br /&gt;
* continue&lt;br /&gt;
* switch&lt;br /&gt;
* return&lt;br /&gt;
* exit&lt;br /&gt;
&lt;br /&gt;
== if ==&lt;br /&gt;
The &amp;#039;&amp;#039;if&amp;#039;&amp;#039; construct is one of the most important features of many languages. It allows for conditional execution of code fragments. NXSL features an &amp;#039;&amp;#039;if&amp;#039;&amp;#039; structure that is similar to that of C: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if (expr)&lt;br /&gt;
   statement&lt;br /&gt;
&lt;br /&gt;
== else ==&lt;br /&gt;
Often you&amp;#039;d want to execute a statement if a certain condition is met, and a different statement if the condition is not met. This is what &amp;#039;&amp;#039;else&amp;#039;&amp;#039; is for. &amp;#039;&amp;#039;else&amp;#039;&amp;#039; extends an &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statement to execute a statement in case the expression in the &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statement evaluates to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;. The &amp;#039;&amp;#039;else&amp;#039;&amp;#039; statement is only executed if the &amp;#039;&amp;#039;if&amp;#039;&amp;#039; expression evaluated to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== while ==&lt;br /&gt;
&amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops are the simplest type of loop in NXSL. They behave just like their C counterparts. The basic form of a &amp;#039;&amp;#039;while&amp;#039;&amp;#039; statement is: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 while (expr)&lt;br /&gt;
     statement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The meaning of a &amp;#039;&amp;#039;while&amp;#039;&amp;#039; statement is simple. It tells NXSL to execute the nested statement(s) repeatedly, as long as the &amp;#039;&amp;#039;while&amp;#039;&amp;#039; expression evaluates to &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;. The value of the expression is checked each time at the beginning of the loop, so even if this value changes during the execution of the nested statement(s), execution will not stop until the end of the iteration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== do-while ==&lt;br /&gt;
&amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; loops are very similar to &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops, except the truth expression is checked at the end of each iteration instead of in the beginning. The main difference from regular &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loops is that the first iteration of a &amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; loop is guaranteed to run (the truth expression is only checked at the end of the iteration), whereas it may not necessarily run with a regular &amp;#039;&amp;#039;while&amp;#039;&amp;#039; loop (the truth expression is checked at the beginning of each iteration, if it evaluates to FALSE right from the beginning, the loop execution would end immediately).&lt;br /&gt;
&lt;br /&gt;
== for ==&lt;br /&gt;
&amp;#039;&amp;#039;for&amp;#039;&amp;#039; loops are the most complex loops in NXSL. They behave like their C counterparts. The syntax of a &amp;#039;&amp;#039;for&amp;#039;&amp;#039; loop is: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 for (expr1; expr2; expr3)&lt;br /&gt;
     statement&lt;br /&gt;
&lt;br /&gt;
The first expression (&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;) is evaluated (executed) once unconditionally at the beginning of the loop. &lt;br /&gt;
&lt;br /&gt;
In the beginning of each iteration, &amp;#039;&amp;#039;expr2&amp;#039;&amp;#039; is evaluated. If it evaluates to &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;, the loop continues and the nested statement(s) are executed. If it evaluates to &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;, the execution of the loop ends. &lt;br /&gt;
&lt;br /&gt;
At the end of each iteration, &amp;#039;&amp;#039;expr3&amp;#039;&amp;#039; is evaluated (executed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== break ==&lt;br /&gt;
&amp;#039;&amp;#039;break&amp;#039;&amp;#039; ends execution of the current &amp;#039;&amp;#039;for&amp;#039;&amp;#039;, &amp;#039;&amp;#039;while&amp;#039;&amp;#039;, &amp;#039;&amp;#039;do-while&amp;#039;&amp;#039; or &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; structure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== continue ==&lt;br /&gt;
&amp;#039;&amp;#039;continue&amp;#039;&amp;#039; is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== switch ==&lt;br /&gt;
The &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; statement is similar to a series of &amp;#039;&amp;#039;if&amp;#039;&amp;#039; statements on the same expression. In many occasions, you may want to compare the same variable (or expression) with many different values, and execute a different piece of code depending on which value it equals to. This is exactly what the &amp;#039;&amp;#039;switch&amp;#039;&amp;#039; statement is for.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  switch (input) &lt;br /&gt;
  {&lt;br /&gt;
    case &amp;quot;1&amp;quot;:&lt;br /&gt;
      trace(0,&amp;quot;Input is 1&amp;quot;);&lt;br /&gt;
      break;&lt;br /&gt;
    case &amp;quot;2&amp;quot;:&lt;br /&gt;
      trace(0,&amp;quot;Input is 2&amp;quot;);&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      trace(0, &amp;quot;Input is unknown&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== return ==&lt;br /&gt;
If called from within a function, the &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; statement immediately ends execution of the current function, and returns its argument as the value of the function call. Calling &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; from main() function (either explicitly or implicitly defined) is equivalent of calling &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== exit ==&lt;br /&gt;
The &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt; statement immediately ends execution of the entire script, and returns its argument as script execution result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Expressions =&lt;br /&gt;
The simplest yet most accurate way to define an expression is &amp;quot;anything that has a value&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The most basic forms of expressions are constants and variables. When you type &amp;quot;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; = 5&amp;quot;, you&amp;#039;re assigning &amp;#039;5&amp;#039; into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;. &amp;#039;5&amp;#039;, obviously, has the value 5, or in other words &amp;#039;5&amp;#039; is an expression with the value of 5 (in this case, &amp;#039;5&amp;#039; is an integer constant).&lt;br /&gt;
&lt;br /&gt;
Slightly more complex examples for expressions are functions. Functions are expressions with the value of their return value. &lt;br /&gt;
&lt;br /&gt;
NXSL supports the following value types: integer values, floating point values (float), string values and arrays. Each of these value types can be assigned into variables or returned from functions. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another good example of expression orientation is pre- and post-increment and decrement. You be familiar with the notation of &amp;#039;&amp;#039;variable++&amp;#039;&amp;#039; and &amp;#039;&amp;#039;variable--&amp;#039;&amp;#039;. These are increment and decrement operators. In NXSL, like in C, there are two types of increment - pre-increment and post-increment. Both pre-increment and post-increment essentially increment the variable, and the effect on the variable is identical. The difference is with the value of the increment expression. Pre-increment, which is written &amp;#039;++&amp;#039;&amp;#039;variable&amp;#039;&amp;#039;&amp;#039;, evaluates to the incremented value. Post-increment, which is written &amp;#039;&amp;#039;&amp;#039;variable&amp;#039;&amp;#039;++&amp;#039; evaluates to the original value of variable, before it was incremented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A very common type of expressions are comparison expressions. These expressions evaluate to either &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;.&amp;lt;nowiki&amp;gt; NXSL supports &amp;gt; (bigger than), &amp;gt;= (bigger than or equal to), = (equal), != (not equal), &amp;lt; (smaller than) and &amp;lt;= (smaller than or equal to). These expressions are most commonly used inside conditional execution, such as &amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;if&amp;#039;&amp;#039; statements. &lt;br /&gt;
&lt;br /&gt;
The last example of expressions is combined operator-assignment expressions. You already know that if you want to increment &amp;#039;&amp;#039;a&amp;#039;&amp;#039; by 1, you can simply write &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;++&amp;#039; or &amp;#039;++&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039;. But what if you want to add more than one to it, for instance 3? In NXSL, adding 3 to the current value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; can be written &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; += 3&amp;#039;. This means exactly &amp;quot;take the value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, add 3 to it, and assign it back into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;quot;. In addition to being shorter and clearer, this also results in faster execution. The value of &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039; += 3&amp;#039;, like the value of a regular assignment, is the assigned value. Notice that it is NOT 3, but the combined value of &amp;#039;&amp;#039;a&amp;#039;&amp;#039; plus 3 (this is the value that&amp;#039;s assigned into &amp;#039;&amp;#039;a&amp;#039;&amp;#039;). Any two-place operator can be used in this operator-assignment mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Short-circuit evaluation ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Short-circuit_evaluation Short-circuit evaluation] denotes the semantics of some Boolean operators in which the second argument is only executed or evaluated if the first argument does not suffice to determine the value of the expression: when the first argument of the AND function evaluates to false, the overall value must be false; and when the first argument of the OR function evaluates to true, the overall value must be true. NXSL uses short-circuit evaluation for &amp;amp;&amp;amp; and || boolean operators. This feature permits two useful programming constructs. Firstly, if the first sub-expression checks whether an expensive computation is needed and the check evaluates to false, one can eliminate expensive computation in the second argument. Secondly, it permits a construct where the first expression guarantees a condition without which the second expression may cause a run-time error. Both are illustrated in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
if ((x != null) &amp;amp;&amp;amp; ((trim(x) == &amp;quot;abc&amp;quot;) || (long_running_test(x)))  &lt;br /&gt;
   do_something();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Without short-circuit evaluation, trim(x) would cause run-time error if x is null. Also, long running function will only be called if condition (trim(x) == &amp;quot;abc&amp;quot;) will be false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=Scripting_Guide&amp;diff=1751</id>
		<title>Scripting Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=Scripting_Guide&amp;diff=1751"/>
		<updated>2020-10-05T13:50:49Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[SG:Introduction|Introduction]]&lt;br /&gt;
&lt;br /&gt;
[[UM:NetXMS Scripting Language (NXSL)|Language Description]]&lt;br /&gt;
&lt;br /&gt;
[[SG:Security Issues|Security Issues]]&lt;br /&gt;
&lt;br /&gt;
[[SG:Script Examples|Script Examples]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL Formal Grammar]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL Function Reference]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL Class Reference]]&lt;br /&gt;
&lt;br /&gt;
[[NXSL Syntax highlight and calltips]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1750</id>
		<title>SG:Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1750"/>
		<updated>2020-10-05T13:49:51Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Introduction}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; for current version of the documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1749</id>
		<title>SG:Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1749"/>
		<updated>2020-10-05T10:32:11Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Introduction}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please visit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1748</id>
		<title>SG:Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1748"/>
		<updated>2020-10-05T10:31:57Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Introduction}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please wisit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1747</id>
		<title>SG:Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=SG:Introduction&amp;diff=1747"/>
		<updated>2020-10-05T10:31:49Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Introduction}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing: 20px; border: 20px solid red;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WARNING&amp;#039;&amp;#039;&amp;#039;: This page is no longer updated. Please wisit &amp;#039;&amp;#039;&amp;#039;[https://www.netxms.org/documentation/nxsl-latest/ NetXMS Scripting Language]&amp;#039;&amp;#039;&amp;#039; documentation. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In many parts of the system, fine tuning can be done by using NetXMS built-in scripting language called NXSL (stands for NetXMS Scripting Language). NXSL was designed specifically to be used as embedded scripting language within NetXMS, and because of this has some specific features and limitations. Most notable is very limited access to data outside script boundaries – for example, from NXSL script you cannot access files on server, nor call external programs, nor even access data of the node object other than script is running for without explicit permission. NXSL is interpreted language – scripts first compiled into internal representation (similar to byte code in Java), which than executed inside NXSL VM.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Guide]]&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
	<entry>
		<id>https://wiki.netxms.org/index.php?title=NXSL:FindDCIByName&amp;diff=1746</id>
		<title>NXSL:FindDCIByName</title>
		<link rel="alternate" type="text/html" href="https://wiki.netxms.org/index.php?title=NXSL:FindDCIByName&amp;diff=1746"/>
		<updated>2020-08-12T10:49:17Z</updated>

		<summary type="html">&lt;p&gt;Phil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Find DCI by name (search is case-insensetive).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
FindDCIByName(&amp;#039;&amp;#039;node&amp;#039;&amp;#039;, &amp;#039;&amp;#039;parameter name&amp;#039;&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;node&amp;#039;&amp;#039; || [[NXSL:Node|Node]] object. Predefined variable &amp;#039;&amp;#039;&amp;#039;$node&amp;#039;&amp;#039;&amp;#039; can be used to refer to current node in transformation script or event processing policy rule.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;name&amp;#039;&amp;#039; || DCI parameter name.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Return Value ==&lt;br /&gt;
&lt;br /&gt;
DCI ID on success or 0 if DCI with matching name was not found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
 FindDCIByName($node, &amp;quot;Agent.Uptime&amp;quot;)	-&amp;gt; 5   /* perhaps */&lt;br /&gt;
 FindDCIByName($node, &amp;quot;bad&amp;quot;)		-&amp;gt; 0&lt;/div&gt;</summary>
		<author><name>Phil</name></author>
	</entry>
</feed>