Product Documentation
Virtuoso Studio Design Environment SKILL Reference
Product Version IC23.1, November 2023

dbSetq, dbSet

dbSetq( d_object g_value St_AttrOrPropName ) 
 => g_value / nil 
dbSet( d_object g_value St_AttrOrPropName ) 
 => g_value / nil 

Description

Modifies the value of an attribute or a property associated with a database object.

The equal sign (“=”) and g_value are required for the “~>” implementation of the dbSet function, unlike the “=>” (“yields”) symbol used previously, which documents the output of the dbGet function. Also, the “~>” operator does not accept the “?” or “??” operations when combined with the assignment operator (“=”).

For dbSetq and the ‘‘~>’’ operator, the attribute or property name St_AttrPropName can be specified as either a string or a symbol. For dbSet, this argument can also be specified as a variable because dbSet evaluates its second argument.

If the specified St_AttrOrPropName is not an attribute name of object d_Object, it is treated as the name of a property for that object. If a property by that name does not exist, one is created.

Attaching and detaching an object to and from another object can be done by setting their relationship attributes. The types of relationship that can be set using this method are limited to one-to-one and many-to-one. The attribute value is set to dbObject to attach and nil to detach.

The next section of this chapter contains tables that describe the database objects and their attributes. Within the tables, attributes that can be set are labeled.

Arguments

d_object

Database object.

g_value

The new value for the attribute or property St_AttrOrPropName.

St_AttrOrPropName

Specifies the name of the attribute or property to be set. It can be specified as a SKILL symbol or a string. For dbSet, this can also be a SKILL variable containing a symbol or a string that represents the attribute or property name.

Value Returned

g_value

Returns the new value if successful.

nil

Returns nil if not.

Examples

Sets the value of the width attribute associated with a path object p by any of the following:

dbSetq(p 2 width) ;      ; Does not evaluate third argument 
p~>width = 2 ; ; Equivalent to above
p~>"width" = 2 ; ; Equivalent to above
dbSet(p 2 ’width) ; ; Evaluates 1st & 3rd arguments
w = ’width ; ; Assigns attribute name
dbSet(p 2 w) ;   ; "w" is evaluated to width
; Attach figure f to net n: 
dbSetq(f n net) ; ; Does not evaluate third argument
f~>net = n ;   ; Equivalent to above
; Detach figure f from its net: 
dbSet(f nil ’net) ; ; Evaluates 1st & 3rd argument
f~>net = nil ;   ; Equivalent to above

Related Topics

dbSet Functions


Return to top
 ⠀
X