NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check whether array with string is empty or not

From the TestStand help:

 

GetNumSubProperties Method
Syntax
PropertyObject.GetNumSubProperties ( lookupString)

Return Value
Long

Number of subproperties within the property specified by lookupString.

Purpose
Returns the number of subproperties directly within the property the lookupString parameter specifies.

Parameters
lookupString As String

[In] Pass an empty string to denote the PropertyObject to which the method applies, or pass the name of a subproperty within the PropertyObject. Refer to Lookup Strings for more information about the strings you can use.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 11 of 14
(1,450 Views)

This is not working, and it is from the test stand help.

 

 Locals.BarcodeLengthAct   =  GetNumElement (Locals.BarcodeStrings[0]

 

 

0 Kudos
Message 12 of 14
(1,374 Views)

fullmanido,

 

Try this instead:

 

Locals.BarcodeLengthAct   =  GetNumElements (Locals.BarcodeStrings[0])

 

 

I changed "GetNumElement" to "GetNumElements" and closed the parenthesis. I believe this will work properly. Let us know if you run into any more trouble with it!

0 Kudos
Message 13 of 14
(1,372 Views)

If the array you want the size of is Locals.BarcodeStrings you should use this instead:

 

Locals.BarcodeLengthAct   =  GetNumElements (Locals.BarcodeStrings)

 

Not sure why you had [0] in there. That doesn't make sense unless you have an array of arrays and you want the size of the first array in an array of arrays.

 

-Doug

0 Kudos
Message 14 of 14
(1,353 Views)