Features:
Enumerates all NLMs loaded on a server.
Supports several other functions, such as loading and updating NLMs.
Finds an NLM in the collection.
object.Element(
ModuleName As String)
The name of the NLM to find. You can optionally specify the object's full path.
Module.
If the module is not found, the method returns the value NULL. If the full path is specified along with the name of the module, the NLM header is read from the corresponding NLM file and a Module object is returned.
This example returns the Module object calnlm32.nlm.
’Find a Module object corresponding to calnlm32
’Print the copyright information of calnlm32
set srv = createobject ("ucx:Server")
set modules = srv.modules
set module = Modules.element("calnlm32.nlm")
print ("Copyright of calnlm32 is " &Module.copyright)
Determines whether or not any more NLMs exist in the collection.
object.HasMoreElements()
None.
Boolean. Returns TRUE if more NLMs exist in the collection; otherwise, FALSE.
This example determines whether or not any more NLMs exist in the collection.
’Reset the collection and list all the loaded NLMs
set srv = createobject ("ucx:Server")
set modules = srv.modules
Modules.reset()
while (Modules.hasmoreelements())
set module=Modules.next()
print (Module.name)
wend
Loads an NLM.
object.Load(
ModuleName As String)
The name of the NLM to load. You can optionally specify the full path of the NLM file. This parameter can contain the entire command line option, including the arguments.
Boolean. Returns TRUE if the NLM is successfully loaded; otherwise, FALSE.
If the Web-based script is not authenticated to eDirectory with appropriate rights, an error is returned.
This example loads the NDS API NLM.
’Load DSAPI.NLM
set srv = createobject ("ucx:Server")
set modules = srv.modules
if (Modules.load ("dsapi.nlm")) then
Print ("NDS API NLM is loaded")
else
Print ("Failed to load NDS API NLM ")
end if
Determines whether or not an NLM is already loaded.
object.Loaded(
ModuleName As String)
The name of the NLM. You can optionally specify the object's full path.
Boolean. Returns TRUE if the NLM is already loaded; otherwise, FALSE.
This example determines whether or not dsapi.nlm is already loaded. If it is not, the Load property will load it.
’Verify whether or not dsapi.nlm is already loaded
’If not, load dsapi.nlm
set srv = createobject ("ucx:Server")
set modules = srv.modules
if (Modules.loaded ("dsapi.nlm")) then
Print ("NDS API NLM is loaded")
else
Print ("Loading NDS API NLM ")
Modules.Load ("dsapi.nlm")
end if
Returns the next NLM in the collection.
object.Next()
None.
Module. Returns NULL if the collection has no more elements.
This example returns the next NLM in the collection.
’Reset the collection and list all the loaded NLMs
set srv = createobject ("ucx:Server")
set modules = srv.modules
Modules.reset()
while (Modules.hasmoreelements())
set module=Modules.next()
print (Module.name)
wend
Updates an NLM by replacing an old version with a new version.
object.Replace(
OldNLM As String,
NewNLM As String)
The full path of the existing NLM file.
The full path of the new NLM file.
Boolean. Returns TRUE if the NLM is replaced; otherwise, FALSE.
This example updates the test.nlm file by replacing the old version (sys:system\test.nlm) with the new version (sys:temp\test.nlm).
’Replace the old version of test.nlm with the new version of test.nlm
set server = CreateObject ("ucx:Server")
set modules = server.Modules
if (Modules.Replace ("sys:system\test.nlm", "sys:temp\test.nlm")) then
print ("Replaced Test.nlm ")
else
print ("Failed to replace Test.nlm ")
end if
Resets the collection and starts an iteration.
object.Reset()
None.
Void.
This example resets the collection and starts an iteration.
’Reset the collection and list all the loaded NLMs
set srv = createobject ("ucx:Server")
set modules = srv.modules
Modules.reset()
while (Modules.hasmoreelements())
set module=Modules.next()
print (Module.name)
wend