XSICollection.GetAsText
 
 
 

XSICollection.GetAsText

Description

Returns the collection as a string expression. This is particularly useful if you need to pass the contents of a collection to a command that only takes a list of objects as a string expression.

C# Syntax

String XSICollection.GetAsText();

Scripting Syntax

oString = XSICollection.GetAsText();

Return Value

String

Examples

VBScript Example

Dim oColl             ' object pointer for collection
Dim oItem               ' object pointer for member
' Create a collection as an ActiveX object
Set oColl = CreateObject("XSI.Collection")
' Populate it
oColl.Add "Camera"
oColl.Add "Light"
' See what kind of object it is
LogMessage "The whole collection is a " & TypeName( oColl )
' See what kind of return value GetAsText returns
LogMessage oColl.GetAsText & " is a " & TypeName( oColl.GetAsText )
' You can also return a single item as an object pointer
Set oItem = oColl.Item(0)
LogMessage oItem & " is a " & TypeName( oItem )
'--------------------------------------------------
' Output of above script:
'INFO : "The whole collection is a Object"
'INFO : "Camera,light is a String"
'INFO : "Camera is a Camera"

See Also

XSICollection.Item XSICollection.SetAsText