To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates how to search, find, highlight, and color characters or words in a string control. An event structure monitors the front panel controls buttons.
Description
When you press the Highlight Next Word button, the VI searches for a space in the string control to determine when a word starts and ends. The VI highlights the word that occurs before the space. The shift register stores the position of the last highlighted word.
When you press the Color Words button, the VI searches for the text you specifiy and colors all instances of that string with the color you specify.
The Searching Algorithm SubVI uses the Match Pattern function to find an instance of the string in the Text to Search textbox. The top level VI uses the Searching Algorithm VI in a While Loop to build the location of each matching pattern into an array. Finally, the top level VI uses an indexed for loop to read one value from the array at a time and change those values using a property node before displaying the resulting text in the Highlighted Text indicator.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Additional Information or References
Front Panel
Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This was GREAT!!!!!! Exactly what I needed. Great Job!