.. highlightlang:: us .. index:: auto_ReplaceText .. _auto_replacetext: auto_ReplaceText ================ .. us.tag auto_ReplaceText NOTREADYENGLISH :ref:`auto_ReplaceText` executes a find and replace command. The function searches in text objects and axis titles for the find text and replaces it with the specified text. .. function:: hText = auto_ReplaceText(ssFind, ssReplace) hText = auto_ReplaceText(ssFind, ssReplace, bEdit) hText = auto_ReplaceText(ssFind, rsReplace) hText = auto_ReplaceText(ssFind, rsReplace, bEdit) .. us.return **Return Value** *hText* is the handle of the text object where the find text was found. If the find text was found in more than one text object, the handle of the last object is returned. The function returns 0 if the find text could not be found. .. us.params **Parameters** .. uparam:: ssFind *ssFind* is the text that should be replaced. The text should be enclosed in ``$`` symbols, for example: ``$User$``. .. uparam:: ssReplace *ssReplace* is the new text. .. uparam:: rsReplace *rsReplace* is a real value. The value will be converted to a string. .. uparam:: bEdit If *bEdit* is TRUE (1) the placeholder text will be copied from the text field into the name field. If *bEdit* is FALSE (0) the placeholder text will not be copied from the text field into the name field. Default value is FALSE. If the placeholder is copied into the name field the :ref:`edit-objectplaceholder-dialog` dialog will display the text. .. us.comment **Comment** If you insert a placeholder into the text element, the name field must be empty. Placeholders in name field have a higher priority than placeholders in the text element. If the text field contains several placeholders, the text is automatically copied into the name field. .. us.example **Example** Example 1: :: auto_LoadTemplate(GetRootDirectory() + "/template/tpl1.ipw") auto_ReplaceText("$OPERATOR$", "Mr. Miller") auto_ReplaceText("$GREEKLETTERS$", "\a\b\c\A\B\C") auto_ReplaceText("$TWOLINES$", "Rows 1\r\nZeile2") rsValue = 123.23 auto_ReplaceText("$Value$", sprintf("%.2lf", rsValue)) auto_UpdatePage() .. seealso:: :ref:`overview-automation`, :ref:`auto_ReplaceTextDialog`, :ref:`edit-objectplaceholder-dialog`, :ref:`sprintf` :sub:`id-1071328`