Applies to TestComplete 14.50, last modified on August 05, 2020

Description

Replaces the current indicator text with the string specified by the Text parameter.

Declaration

Indicator.PushText(Text)

Text [in]    Required    String    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Text

String specifying the new indicator text.

Result Value

None.

Remarks

When you set the new indicator text, the old text is not removed. It is saved and can be restored later by calling the PopText method. For more information on how PushText and PopText work, see Indicator Object.

The indicator updates its text every 500 milliseconds. So, if you change the text more frequently, some values will not display on screen.

Example

The code below demonstrates how you can set, restore and obtain the text that is shown under the indicator's icon.

JavaScript, JScript

function IndicatorDemo()
{
  // Shows the indicator icon
  Indicator.Show();
  // Pushes text to the indicator
  Indicator.PushText("Hello!");
  // Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text);
  
  // Pushes new text to the indicator
  Indicator.PushText("New indicator text.");
  aqUtils.Delay(2000, Indicator.Text);
  
  // Restores the previous indictor text - "Hello!"
  Indicator.PopText();
  aqUtils.Delay(2000, Indicator.Text);
  
  // Clears the history of the indicator's user messages
  Indicator.Clear();
  
  // Hides the indicator icon
  Indicator.Hide();
}

Python

def IndicatorDemo():
  # Shows the indicator icon
  Indicator.Show()
  # Pushes text to the indicator
  Indicator.PushText("Hello!")
  # Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text)
  # Pushes new text to the indicator 
  Indicator.PushText("New indicator text.")
  aqUtils.Delay(2000, Indicator.Text)
  # Restores the previous indictor text - "Hello!"
  Indicator.PopText()
  aqUtils.Delay(2000, Indicator.Text)
  # Clears the history of the indicator's user messages
  Indicator.Clear()
  # Hides the indicator icon
  Indicator.Hide()

VBScript

Sub IndicatorDemo()

  ' Shows the indicator icon
  Indicator.Show()
  ' Pushes text to the indicator
  Indicator.PushText("Hello!")
  ' Delays the script execution for 2 seconds
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Pushes new text to the indicator
  Indicator.PushText("New indicator text.")
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Restores the previous indictor text - "Hello!"
  Indicator.PopText()
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Clears the history of the indicator's user messages
  Indicator.Clear()
  
  ' Hides the indicator icon
  Indicator.Hide()

End Sub

DelphiScript

function IndicatorDemo;
begin

  // Shows the indicator icon
  Indicator.Show;
  // Pushes text to the indicator
  Indicator.PushText('Hello!');
  // Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text);
  
  // Pushes new text to the indicator
  Indicator.PushText('New indicator text.');
  aqUtils.Delay(2000, Indicator.Text);
  
  // Restores the previous indictor text - "Hello!"
  Indicator.PopText;
  aqUtils.Delay(2000, Indicator.Text);
  
  // Clears the history of the indicator's user messages
  Indicator.Clear;
  
  // Hides the indicator icon
  Indicator.Hide;

end;

C++Script, C#Script

function IndicatorDemo()
{
  // Shows the indicator icon
  Indicator["Show"]();
  // Pushes text to the indicator
  Indicator["PushText"]("Hello!");
  // Delays the script execution for 2 seconds
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Pushes new text to the indicator
  Indicator["PushText"]("New indicator text.");
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Restores the previous indictor text - "Hello!"
  Indicator["PopText"]();
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Clears the history of the indicator's user messages
  Indicator["Clear"]();
  
  // Hides the indicator icon
  Indicator["Hide"]();
}

See Also

Indicator Object
Clear Method
PopText Method
Text Property

Highlight search results