Comparing Characters

Use the Decimal Digit?, Hex Digit?, Octal Digit?, Printable?, White Space?, and Lexical Class functions to compare characters to determine the type of a character.

Complete the following steps to use the character Comparison functions.

  1. Select a string control on the Controls»String & Path palette and place it on the front panel. Repeat to place another string control on the front panel.
  2. On the block diagram, select Functions»Comparison to place a character Comparison function on the block diagram.
  3. Wire one string control to the top input of the Comparison function and the other string control to the bottom input of the Comparison function.
  4. Right-click the Comparison function output and select Create»Indicator. LabVIEW wires a Boolean indicator to the Comparison function.
  5. On the front panel, enter a value into both string controls and click the Run button. The Comparison function compares both inputs and changes the Boolean indicator accordingly.

If the inputs to the Comparison function are strings, the functions test the first character. If the inputs are empty strings, the result is FALSE. If the inputs are numbers, the functions interpret them as a code for an ASCII character.