Smart Buttons
Controls/XML Elements
Get Text From Terminal <GetString>
This element captures text from the Smartpoint terminal window. You can either:
-
Read text from a specific column and row.
-
Use a regular expression (regex).
Configuring
It is recommended to configure using the Get Text from Terminal Editor.
To configure with the Get Text from Terminal Editor:
-
Open the Smart Buttons Editor to create a script.
-
Click Get Text from Terminal <GetString> .
-
Configure the attributes.
Attribute
Description
Variable name Enter the name of variable to store the content read from the terminal window. Column Enter the column to read. Row Enter the row to read.
How to calculate column and rowTo calculate which row and column you want the script to read from, make the commands in native mode.
For example, if you want the script to get the total price from a fare quote response:
-
Click Ctrl+N to open Smartpoint in native mode.
-
Enter FQ.
-
Copy the response from the screen and paste it to Notepad++.
-
Place the cursor next to the Grand Total Amount.
-
Read the Column and Row number from the bottom of the document.
Tip!
When running the Run terminal command <RunCommand> control preceding the Get text from terminal control, do not select the Standard command box, which will not send the entry to the host, but only display it in Smartpoint. (Columns and rows may differ between the Smartpoint display and the host native system display).
Length Insert the length of the terminal text that you want the script to read. For example, enter 7 if you want to read seven characters. Search row by content If the value you want to capture is not always in the same row, you search for the value in a row that contains a specific expression. For example, Grand Total may be in different row depending on number of passengers; however, Grand Total can always be found in a row containing the expression: GRAND TOTAL INCLUDING TAXES ****).
ExampleHere is the result: system shows message with Grand Total amount.
Regular expression searchs Select regular expression (regex) functionality, commonly used in programing languages, to define exactly the place that you want to capture data on the screen.
For more information about building a regex line, see https://regex101.com/.
More Information
-
First match only
A standard regex reurns all elements that match the regex pattern. When First match only is selected, regex returns only the first element that matches the regex pattern. -
Single line match
Select to match the expression where the . (dot) matches every character, including a new line character. If regex does not contain the dot (.) metacharacter, the modifier has no impact.
-
-
Click SUBMIT.