4D v16WP GET ATTRIBUTES |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16
WP GET ATTRIBUTES
|
WP GET ATTRIBUTES ( rangeObj | wpDoc ; attribName ; attribValue {; attribName2 ; attribValue2 ; ... ; attribNameN ; attribValueN} ) | ||||||||
Parameter | Type | Description | ||||||
rangeObj | wpDoc | Object |
![]() |
4D Write Pro range or document | |||||
attribName | String |
![]() |
Name of attribute to get | |||||
attribValue | String, Real, Boolean, Array |
![]() |
Current value of attribute for text range | |||||
The WP GET ATTRIBUTES command returns the value of any attribute in a 4D Write Pro range or document. This command gives you access to any kind of 4D Write Pro internal attributes: character, paragraph, document, or image.
In the first parameter, you can pass either a 4D Write Pro range object (rangeObj) or a 4D Write document reference (wpDoc). A rangeObj is a part of a 4D Write Pro document that can be created by different commands. The following table provides the scope of the WP GET ATTRIBUTES command depending on the target object parameter and the attributes:
Parameter | Common attributes (except "verticalAlign") | Document-only attributes | Paragraph-only attributes | Character-only attributes (and "verticalAlign") |
rangeObj from WP Get paragraphs | paragraphs | document | paragraphs | paragraphs |
rangeObj from WP Get pictures | images | document | - | - |
rangeObj from WP Get range or | paragraphs for the range | document | paragraphs for the range (intersecting paragraphs) | characters for the range |
wpDoc | document | document | paragraphs for all the document | characters for all the document |
For a comprehensive list of attributes to pass in attribName, as well as their respective values, please refer to the 4D Write Pro Attributes section.
If there are different values for the same attribute in the range or document passed as a parameter, the command returns:
You want to get the background color of the selected area:
$range:=WP Get selection(*;"WParea")
WP GET ATTRIBUTES($range;wk background color;$bcol)
4D Write Pro Attributes
4D Write Pro Constants
WP RESET ATTRIBUTES
WP SET ATTRIBUTES
Product: 4D
Theme: 4D Write Pro Language
Created: 4D v15 R4
4D Write Pro Reference ( 4D v16)