Share via


Length Element

The Length element returns the length of the string within the element. The value returned can be divided, or subtracted from, by the value of the Div or Sub attribute, respectively.

Syntax

<Length
  Div = "Integer"
  Sub = "Integer">
</Length>

Attributes

Name Description
Div Optional Integer. Specifies how much to divide the resulting value by.
Sub Optional Integer. Specifies how much to subtract from the resulting value.
Parent Elements Child Elements
DisplayPattern, ViewBody Column

Example

The following line sets a variable named TextLength:

<SetVar Name="TextLength">This is some text that is 45 characters long.</SetVar>

and the next block of code,

<Length Div="5">
  <GetVar Name="TextLength"/>
</Length>

divides the variable's value by 5 to render the number 9.