This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
WP GET ATTRIBUTES

WP GET ATTRIBUTES 


 

WP GET ATTRIBUTES ( targetObj ; attribName ; attribValue {; attribName2 ; attribValue2 ; ... ; attribNameN ; attribValueN} ) 
Parameter Type   Description
targetObj  Object in Range or element or 4D Write Pro document
attribName  Text in Name of attribute to get
attribValue  Text, Number, Array, Collection, Picture, Date in Current value of attribute for the target

The WP GET ATTRIBUTES command returns the value of any attribute in a 4D Write Pro range, header, body, footer, table, or document. This command gives you access to any kind of 4D Write Pro internal attributes: character, paragraph, document, table, or image.

In targetObj, you can pass:

  • a range, or
  • an element (header / footer / body / table / paragraph / anchored or inline picture / section / subsection / style sheet), or
  • a 4D Write Pro document

For a comprehensive list of attributes to pass in attribName, as well as their scope and values, please refer to the 4D Write Pro Attributes section.

If there are different values for the same attribute in the element passed as a parameter, the command returns:

  • for numerical values, wk mixed
  • for an array, an empty array (tab stops, color if attribValue is defined as array), with an exception for wk text shadow offset for which the array value will always contain 2 entries which may be set separately to wk mixed if either horizontal offset or vertical offset (or both) are mixed.
  • for string values, an empty string
  • for picture values, an empty picture.

Note: If targetObj contains a paragraph and a character style sheets, the paragraph style sheet name is returned.

Example  

You want to get the background color of the selected area:
 

 $range:=WP Selection range(*;"WParea")
 WP GET ATTRIBUTES($range;wk background color;$bcol)



See also 

4D Write Pro Attributes
4D Write Pro Constants
WP RESET ATTRIBUTES
WP SET ATTRIBUTES

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1345

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v15 R4
Modified: 4D v16 R4
Modified: 4D v16 R5
Modified: 4D v17 R3
Modified: 4D v17 R5

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)