Skip to main content



Type Conversion and Creation

Note that these APIs exist principally for CLR interop purposes; they are generally unnecessary for use inside irScript proper, where implicit type conversions are performed by the language itself, as needed.

Method NameReturn typeArgumentsDescription
ToGuidSystem.GuidelementCreates a new guid from the supplied Text value element
ToEnum<varies>fullyQualifiedEnum TypeName, textualEnumValueCreates a new System.Enum- subclassed value corresponding to the specified type name (CLR namespace+type) and textual value representation
IsNativeIntegerBooleanelementReturns true if element is a 64-bit signed integer, otherwise false
IsNativeDecimalBooleanelementReturns true if element is a System.Decimal value, otherwise false
IsNativeCollectionBooleanelementReturns true if element is a native irScript ScriptCollection, otherwise false
CreateDictionarySystem.IDictiona ry<string, object><none>Creates and returns a new, empty CLR dictionary
ToArraySystem.Array of designated typecollection, elementTypeCreates a new CLR array with elements of type elementType and copies the elements of collection into it; all elements must be of type elementType or subclasses of elementType
ToArrayWithTran sformSystem.Array of designated typecollection, elementType, transformFunctionCreates a new CLR array with elements of type elementType and copies the elements of collection into it; transformFunction is a ScriptFunction taking one parameter and returning a value; transformFunction is invoked for each element prior to copying, and the result for each element must be of type elementType or a subclass of elementType
ToCollectionScriptCollectioncollectionCreates a new ScriptCollection by copying all elements from collection (any System.IEnumerable instance)
ToIntIntegerAnyConverts argument value to an intrinsic integer value
ToNumberDecimalAnyConverts argument value to an intrinsic decimal value
ToStringTextAnyConverts argument value to an intrinsic string value
ToBoolBooleanAnyConverts argument value to an intrinsic boolean value
ToDateTimeDateTimeAnyConverts argument value to an intrinsic datetime value
ToDateDateAnyConverts argument value to an intrinsic date value
NewCLR object typeAssembly-qualified CLR type name, optional constructor argumentsCreates an instance of the type specified by the first argument (type name), by invoking the constructor that matches the other specified arguments (if none, then invokes default constructor)