Using Clause

Top  Previous  Next

 

This feature is only available to users that hold a Pro License and can be used ONLY in the Code section of the script

 

The UsingClause command is a helper command that is not used directly within a script but which allows you to automatically generate a Using Clause in your script for use with your own code.

 

A Using Clause links an assembly Reference to the actual code in the Code Section of a script. You need to specify both the Reference that allows you to specify and use methods and other code from an external assembly to perform actions within a script that would otherwise not be possible, and the using clause which connects the code with the assembly. If either is not specified, then an error will be thrown.

 

You can use multiple using clause and Reference pairs to use code from multiple external assemblies in your script.

lamp Important: This is very much a power user feature, which is why it is only available with a Pro License. In order to use the Using clause you must be an experienced programmer capable of writing raw code using the C# programming language.

Command Syntax

 

using [AssemblyName];

 

The word 'using', the space character that follows it, the AssemblyName parameter and the closing semicolon are all compulsory as they are required as part of the C# language specification. The clause and its parameter are case sensitive, as required by the C# language.

 

Parameters:

 

AssemblyName: The name of the assembly that should be connected to the code, without any file extension

 

The parameter is compulsory. If the parameter is missing or invalid an error will be thrown.

 

Example:

lamp Note: This clause can ONLY be used in the Code Section of a script and must always be used with a Reference command written into the same section. If you try to use the clause anywhere else in a script an error will be thrown.

[Code]

Reference:"C:\Test\TestAssembly.dll"

using TestAssembly;

 

See Also: Code Section ExecCode Reference