Attach

Syntax

ATTACH string_expression variable

Parameters

Attach can be abbreviated as ATT.

Description

The Attach logic command concatenates the value of a variable or literal to that of a second variable after the last non-whitespace character, and stores the result in the second variable. Embedded whitespace characters in both variables are retained.

Note: Sign and separator characters in number variables are ignored when the value is attached.

The behavior of the Attach logic command can be replicated using the '&' concatenation operator. Use of operators, where possible, rather than manipulative logic commands, is the LDL+ preferred format.

Data truncation

The following data truncation issues apply to use of the Attach logic command:

Restrictions

The following restrictions apply to the use of the Attach logic command:

Note: For an MCP-based system, where numeric attributes containing separators are used with the Attach or AttachAndSpace commands, the effective length of the attribute includes separators. For example, a numeric data item with length 5 and a comma separator can have an effective length of 6, with an included leading zero.

Example

This example uses two result variables, Surname of length 10, and Firstname of length 20.

Surname := "Williams"
Firstname := "Henry"
Attach Surname Firstname   : Sets Firstname to "HenryWilliams", Glb.Length to 13.
Attach "Henry" Surname     : Sets Surname to "WilliamsHe", Glb.Length to 13.
                          : Glb.Length is 13, even though the actual length
                          : of Surname is 10, because truncation has occurred.