DeleteModule

(Engine-Level Function)

Description: Deletes a module from the system.
Warning: This function should be used only by advanced programmers.
Returns: Numeric (see table in comments)
Usage: Script Only.
Function Groups: Compilation and On-Line Modifications,  Advanced Module
Related to: ClearModule | DeleteOptional | DeleteState | DeleteStatement | DeleteVariable
Format: DeleteModule(Module[, IgnoreSource])
Parameters:  
Module   
Required. Any expression that gives the module value of the module to delete.
IgnoreSource
If true, the function will not modify any source file. Also, will not check that .SRC and .RUN files are in sync and therefore will not return a value of 3.
Defaults to FALSE if invalid or not specified.
Comments:

Seldom (if ever) used when adding features to modern VTScada applications.

This statement deletes a module from the system, as well as removing its code from the document file, if certain conditions hold. There must not be any running instances of this module. All of the variables in the module must only be referenced within that module. That is, none of the variables can be referenced outside of the module which they are in. Module itself must not be referenced in any other module at all.
This function returns values as follows

Return Value

Meaning

0

Module successfully deleted.

1

Module not deleted, there are instances of it running.

2

Module not deleted, module is externally referenced.

3

Module not deleted, run files are out of sync.