XSICollection.RemoveAll

説明

コレクションからすべての項目を削除します(コレクションを空にします)。このメソッドを、XSICollection.Remove(一度に単一の項目のみ削除)やXSICollection.RemoveItems(一度に1 つまたは複数の項目を削除)と比較してください。

スクリプト 構文

XSICollection.RemoveAll();

VBScript の例

Dim oColl             ' object pointer for collection
' Create the new collection & populate it
Set oColl = CreateObject( "XSI.Collection" )
oColl.SetAsText "Light,Camera"
' Test contents 
checkContents oColl
' Now clear (empty) the collection & re-test it
LogMessage "----------------"
oColl.RemoveAll
checkContents oColl
'--------------------------------------------------
function checkContents( in_coll )
        If in_coll.Count > 0 Then
                LogMessage "Collection now contains " & in_coll.GetAsText 
        Else
                LogMessage "Collection is empty."
        End If
end function
'--------------------------------------------------
' Output of above script:
'INFO : "Collection now contains light,Camera"
'INFO : "----------------"
'INFO : "Collection is empty."

関連項目

XSICollection.Remove XSICollection.RemoveItems