AddModule

(Engine-Level Function)

Description: Adds a new module to an existing module and returns the value of the newly created module.
Warning: This function should be used only by advanced programmers.
Returns: A new module value
Usage: Script Only.
Function Groups: Compilation and On-Line Modifications, Advanced Module
Related to: AddOptional | AddParameter | AddState | AddStatement | AddVariable | CreateModule | FirstState
Format: AddModule(Parent, Name, Reserved, Attrib, Class, VarTextSize, DocFileName)
Parameters:  
Parent
Required Any expression that returns a module value. Specifies the parent object of the new module.
Name
Required. Any text expression providing a name for the new module.
Reserved
Reserved for future use. Should be set to 0.
Attrib

Required. Any numeric expression giving the module's attribute bits as follows:

Attrib Bit No. Attribute
0 - No special attributes
1 0 Reserved - set to 0
2 1 Queued
4 2 Reserved - set to 0
8 3 Reserved - set to 0
16 4 Reserved - set to 0
32 5 Reserved - set to 0
64 6 Reserved - set to 0
128 7 Reserved - set to 0
256 8 Reserved - set to 0
512 9 Protected


Class
Required. Any numeric expression in the range 0 to 65535, giving the class for the new module.
VarTextSize
Required. Any numeric expression giving the length of the variable declaration for the new module (i.e. NewMod MODULE { a new module }; ).
DocFileName
Required. Any text expression giving the file name of the new module's definition document.
Comments: Seldom (if ever) used when adding features to modern VTScada applications.