vcanim.gif (8357 bytes)SWC_unset
Home ] Sales ] Products ] Services ] Support ] Downloads ]

 

 


SWC_unset

clears a context attribute

SWC_unset is a library function which allows user to remove the context array's elements or the whole context and free memory if the element is ID. Input data are the context array's name and the optional parameter: list of element's names user would like to remove, if this parameter is omitted then the function removes the whole context. Since the context represents a tree structure the attempt to remove the node which has children causes removal of whole branch. If the function succeeds then all elements passed to functions are removed and memory is free otherwise an error is returned.

package require SWC

SWC_unset context attribute-name 
context
 
attribute-name
SWC_unset clears of any of the following attributes and all attributes of the same level of greater. So for example:
SWC_unset databasePath
clears database path and database ID , which are the level 1 entries, as well as the level 1 and 2 entries, namely: scene name, scene ID, element name, element type and element ID.

Attributes Common to the Contexts of All Objects

AttributeName Level Description
 
resource attributes
 
RsrcPath 0 Full name of the resource path.
 
database attributes
 
databasePath 1 This is the path to database.
databaseID 1 This is the name of the database structure. This name may be passed to any SAA routine which requires a pointer to database
 
scene attributes
 
sceneName 2 Name of the scene. This is a pathless file-name.
sceneID 2 This is the name of the scene structure. This name may be passed to any SAA routine which requires a scene
 
element attributes
 
elementName 3 Name of the element.
elementType 3 Element type
elementID 3 Name of an element structure.

Return Value

If SWC_unset succeeds the value of the specified attribute or a list of the values of the specified attributes of the context get returned. If no such attribute is present in the context an error is raised.

Side Effects

None

Examples

SWC_elementGet MyContext
Elem4
SWC_unset MyContext elementType
SWC_set MyContext elementName
can't get elementName: elementName is not defined yet

Gets the element; removes the elementType that causes removal of the whole branch and attempt to get elementName gives an error.

See Also

SWC_set

Behaviors Overview ] Behavior Evaluate ] Behavior Edit ] Debugger ] Console ] Find ] SAA Library ] SW library ] SWC library ] SWN library index ] SWU library ] Attributes Index ] Scripting Examples ]

copyright Video-Collage Inc.