Hi,
We've upgraded our NetXMS installation from 4.5.0 to 5.0.2. Then we had to replace all deprecated functions in our EPP scripts. Now EPP scripts are being compiled successfully.
However, actual execution generates an error - Script (EPP::1) execution error: Script load failed
When we try to Execute Script on a node, even simple
String::right("Test", 2);
gives the following error:
Cannot execute script: Script compilation error (Error 16 in line 1:Requested module not found or cannot be loaded)
Any recommendations on how to fix the issue?
Thank you,
Leo
String functions were deprecated, now string methods should be used:
a = "abc";
b = a.right(2);
println(b);
Documentation should be up to date: https://www.netxms.org/documentation/nxsl-latest/#class-string
Thank you, Filipp, for your quick reply. After another turn of script corrections they seem to be working now.
It is unfortunate that documentation has not been updated. And compilation diagnostics has not been updated too. We wasted quite a few hours because of that. And, as compilation does not catch deprecated code, we cannot be sure we have not missed some places which can fail on execution.
Regards,
Leo
Hi,
is this:
String::right("Test", 2);
really in documentation somewhere? Or some text/example that suggests this is the correct way? Because it is incorrect and never was.
Module::function syntax is supported since 4.x, and some functions were indeed moved to system packages in version 5, but there never been module "String".
Best regards,
Victor
Hi Victor,
Please, see here: https://netxms.org/documentation/nxsl-latest/#func-right
It says: [color=rgba(0, 0, 0, 0.6)]This function is deprecated starting from version 5.0.[/color][color=rgba(0, 0, 0, 0.6)] Please use [/color]String::right() (https://netxms.org/documentation/nxsl-latest/#class-string-right)
Regards,
Leo
Quote from: lroytman on May 17, 2024, 10:45:39 PMHi Victor,
Please, see here: https://netxms.org/documentation/nxsl-latest/#func-right
It says: [color=rgba(0, 0, 0, 0.6)]This function is deprecated starting from version 5.0.[/color][color=rgba(0, 0, 0, 0.6)] Please use [/color]String::right() (https://netxms.org/documentation/nxsl-latest/#class-string-right)
Regards,
Leo
I've updated documentation to be more descriptive.