Toolbox Check for universal script

Hello S.,

I am writing to seek your assistance with a script I’m developing, named “main.sci,” which is intended to be universally compatible across different PCs. A key feature of this script is its ability to check for the presence of specific toolboxes. If a required toolbox is not installed, the script will prompt the user to install it. However, I’m encountering a challenge in detecting the SampleStat Toolbox using the getmodules() command.

Could you advise if there’s an alternative command I should use for this purpose?

Here’s the relevant portion of the script:

// This script checks if the Scilab module named 'module_name' is installed.
// It returns %t if installed, or %f if not.

withStat = with_module("ST_2019");
if withStat == %t then
   disp("SampleStat module enabled");
else
   disp("SampleStat module disabled");
   atomsInstall('ST_2019')
end
res = getmodules()

I appreciate your guidance on this matter.

Best regards.

Hello,

maybe atomsIsInstalled (atomsIsInstalled - Determines whether the module is installed. Returns true if the module is installed, false otherwise.) is better suited.

S.

1 Like

This will return the Scilab library names, not the toolboxes names. Use atomsIsInstalled("ST_2019") for toolboxes code.