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

 

 


SWC_databaseGet

Get a database

SWC_databaseGet is a library procedure which allows users to select, allocate and load a database. The input data is a context array name.

package require SWC

SWC_databaseGet context
context
A container for Softwish objects.

Every time the procedure is called the context is checked for a database resource filename. If it is not present then two consecutive SWC windows are displayed from which the user may select a database resource filename and a database path.

Otherwise, if a database resource filename is present, then the context is checked for a database path. If there is no database path an SWC window is displayed from which the user may select a database by name.

If both a database resource filename and a database path are in the context, the procedure checks whether the database path is included in the database resource file. If not, a SWC window is displayed so that the user may select one of the database names that is in the resource file. When the selection is done the procedure allocates and loads the chosen database, filling the databaseID attribute with the database ID. Then it returns the databaseID.

If the procedure completes successfully the context is filled with information about the database resource file's path, database path and database ID.

Database Specific Attributes

Attribute Name Get Set Fcrvs Attribute Type Description
databaseRsrcFile Y Y N string Full name of the database resource file.
databasePath Y Y N string This is the full name of the database directory. This name may be passed to any SAA routine which requires a database name
databaseID Y Y N string This is the name of the database structure. This name may be passed to any SAA routine which requires a database.

Return Value

If SWC_databaseGet succeeds the return is a databaseID. If this procedure encounters an error it will return an error string message in the TK console window.

Side Effects

May update the SWC allocations lists.

Examples

set resources [file join $env(SI_LOCATION) 3D rsrc DatabaseSys.rsrc]
/claude/softimage-3.51/3D/rsrc/DatabaseSys.rsrc
SWC_set MyContext databaseRsrcFile $resources
/claude/softimage-3.51/3D/rsrc/DatabaseSys.rsrc
set myDatabaseID [SWC_databaseGet MyContext]
Database1

Sets the variable resources to the full database resource file's path and filename, including it's path and path. Sets the attribute databaseRsrcFile to the value of resources. Runs SWC_databaseGet and brings up the SWC window.

See Also

SWC_set
SWC_unset

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.