dbSetq, dbSet
dbSetq(d_object g_valueSt_AttrOrPropName) =>g_value/ nildbSet(d_object g_valueSt_AttrOrPropName) =>g_value/ nil
Description
Modifies the value of an attribute or a property associated with a database object.
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
Value Returned
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
Return to top