Example Code

Find the Location of the First Number in 2D String Array

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Coding that will scan a 2D String Array and prompt the location for the first numeric value in it.

 

Description

The VI uses the lexical class function to determine if the characters in the cell are numeric or not. If there are numeric characters, then the execution will be stopped. The indicators will show at which row and column we found the numeric value. We need to consider that it is zero indexed in order to verify the answer.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Fill the 2D Array as desired.
2. Select the Run button.
3. Verify that column and row prompted to validate answer.

 

Additional Information or References

Snippet.png

Justin Parker
National Instruments
Product Support Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.