Table of Contents

Method SelectMemory

Namespace
Skyline.DataMiner.Automation
Assembly
SLManagedAutomation.dll

SelectMemory(int, string)

Selects the persistent memory file with the specified name to be used as the script memory with the specified ID in the subscript.

public void SelectMemory(int id, string val)

Parameters

id int

The ID of the script memory in the subscript.

val string

The name of the physical script memory file.

Examples

var subscript = engine.PrepareSubScript("MySybscript");
subscript.SelectMemory(1, "file1");	// The script memory of the subscript with ID 1 will be linked to the physical memory file with name "file1".

subscript.StartScript();

Exceptions

ArgumentNullException

val is null.

SelectMemory(int, ScriptMemory)

Selects a persistent script memory from the main script to be used as the persistent script memory with the specified ID in the subscript.

public void SelectMemory(int id, ScriptMemory memory)

Parameters

id int
memory ScriptMemory

Examples

Main script:

var memory = engine.GetMemory("parentMemory");	// The parent script has a script memory with name "parentMemory".
memory.Set(1, "MyValue");	// The first entry of this memory is set to the value "MyValue".

var subscript = engine.PrepareSubScript("MySubscript");

subscript.SelectMemory(1, memory); // The subscript has a script memory with ID 1 and this memory will be linked to the parent memory. subscript.StartScript();

Sub-script:

var memory = engine.GetMemory(1);
engine.GenerateInformation(Convert.ToString(memory.Get(1))); // This will generate an information event with value: "MyValue".

Exceptions

ArgumentNullException

memory is null.

SelectMemory(string, string)

Selects the persistent memory file with the specified name to be used as the script memory with the specified ID in the subscript.

public void SelectMemory(string name, string val)

Parameters

name string

The name of the script memory in the subscript.

val string

The name of the persistent script memory file.

Examples

var subscript = engine.PrepareSubScript("MySubscript");
subscript.SelectMemory("memory1", "file1");	// The script memory of the subscript with name "memory1" will be linked to the physical memory file with name "file1".

subscript.StartScript();

Exceptions

ArgumentNullException

name is null
-or-
val is null.

SelectMemory(string, ScriptMemory)

Selects a persistent script memory from the main script to be used as the persistent script memory in the subscript.

public void SelectMemory(string name, ScriptMemory memory)

Parameters

name string

The name of the script memory of the subscript.

memory ScriptMemory

The script memory of the main script to link.

Examples

Main script:

var memory = engine.GetMemory("parentMemory");	// The parent script has a script memory with name "parentMemory".
memory.Set(1, "MyValue");	// The first entry of this memory is set to the value "MyValue".

var subscript = engine.PrepareSubScript("MySubscript");

subscript.SelectMemory("subscriptMemory", memory); // The subscript has a script memory with name "subscriptMemory" and this memory will be linked to the parent memory. subscript.StartScript();

Sub-script:

var memory = engine.GetMemory("subscriptMemory");
engine.GenerateInformation(Convert.ToString(memory.Get(1))); // This will generate an information event with value: "MyValue".

Exceptions

ArgumentNullException

name is null
-or-
memory is null.