DR SELECT BY ATTRIBUTE

4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next

version 6.0


DR SELECT BY ATTRIBUTE (area; conjunction; code; value)

ParameterTypeDescription
areaLongint4D Draw area
conjunctionInteger0=Only
1=Union
2=Intersection
3=Difference
codeIntegerAttribute code
valueTextValue to compare to attribute

Description

The command DR SELECT BY ATTRIBUTE selects or deselects objects in area based on the object's attributes. DR SELECT BY ATTRIBUTE compares value to the attribute described by code for each object and then selects or deselects those objects according to conjunction.

If conjunction equals 0, the command selects only those objects that meet the criteria.

If conjunction equals 1, the command selects those objects that meet the criteria along with any previously selected objects.

If conjunction equals 2, the command selects those objects that meet the criteria among the currently selected objects.

If conjunction equals 3, the command deselects the objects that meet the criteria among the currently selected objects.

DR SELECT BY ATTRIBUTE is similar to a built search in 4th Dimension. It allows you to combine search criteria using repetitive calls.

value is of type Text, even though most of the attributes are expressed numerically. This is because one of the attributes that can be searched is name, which must be expressed as a string. For all other attributes, you must supply a text representation of the number (i.e., "2" or "4.375") for value. To determine the value needed, see the command that affects that attribute. For example, to determine how to specify a fill pattern, see the DR SET FILL ATTRIBUTES command.

code is an integer from the standard list of attribute codes. See Appendix A, Attribute Codes for a complete list of attribute codes and corresponding array types. Note that you can search only some of the attributes.

DR SELECT BY ATTRIBUTE cannot select by object ID. Use DR SELECT to select objects by ID.

Example

The following example selects all rectangles and ovals that are filled with pattern 3 (solid), which are not rotated (angle equals 0°), and which have a name (Name # "").

   DR SET UPDATE MODE (Area;0)
      `Turn updating off
   DR SELECT BY ATTRIBUTE (Area;0;1;"5")
      `Find rectangles
   DR SELECT BY ATTRIBUTE (Area;1;1;"7")
      `and ovals
   DR SELECT BY ATTRIBUTE (Area;2;12;"3")
      `that are filled with a solid pattern
   DR SELECT BY ATTRIBUTE (Area;2;11;"0")
      `and not rotated
   DR SELECT BY ATTRIBUTE (Area;3;3;"")
      `and not named with empty string
   DR SET UPDATE MODE (Area;1)
      `Turn updating on

See Also

DR SELECT.


4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next