Technical Reference > Graphics Builder Automation Interface > Text Property Functions > AttributeText

AttributeText

Sets the text for a text object, or retrieves the current text.

Syntax

AttributeText(Text)

Text:

The text object's text as a string.

Return Value

If retrieving the current text for the object, the text is returned as a string. If setting the text, a 0 (zero) is returned if successful. In both cases, an error is returned if unsuccessful. If values are out of range on writing to the attribute, the function will exit and report the error E_INVALIDARG. If there is no active text object, these functions throw an exception with a return value of E_HANDLE.

Note: For details on handling return and error values, see Error Handling.

Related Functions

AttributeTextStyle, AttributeTextJustification, AttributeTextFont, AttributeTextFontSize, AttributeTextColour

Example

' Sets the text for the currently text object
GraphicsBuilder.AttributeText = "TestText"

' Retrieves text for the current text object
MyVariable = GraphicsBuilder.AttributeText

This function is implemented in the C++ environment as two separate functions: put_AttributeText sets the text for the currently selected text object, and get_AttributeText retrieves the text for the current text object.