NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Traverse Variables in FileGlobals

Solved!
Go to solution

Is there a way to traverse all the variables under FileGlobals as key and value pair? I'm having trouble finding a function that will give me all the variable names for PropertyObject.

- Jimmy
0 Kudos
Message 1 of 5
(3,116 Views)

First of all I'm confused by your "key and value pair" statement.  What did you mean by that?

 

Secondly you can use: FileGlobals.GetNthSubPropertyName("", N, 0) to get the name of the sub property.  N is the index.

 

Here is from the help:

GetNthSubPropertyName Method
Syntax
PropertyObject.GetNthSubPropertyName ( lookupString, index, options)

Return Value
String

Name of the subproperty the index specifies.

Purpose
Returns the name of a subproperty 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.

index As Long

[In] Pass the zero-based index of the subproperty.

options As Long

[In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.

 

GetNumSubProperties is also a good method to use.  Just call FileGlobals.GetNumSupProperties("").

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(3,105 Views)

I threw together a simple example to recursively get all the children of fileglobals.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 5
(3,102 Views)

Hello Jigg, thanks for responding. Can you convert the sequence file to 4.2.x format?

- Jimmy
0 Kudos
Message 4 of 5
(3,080 Views)
Solution
Accepted by topic author jxjimmy

Here you go.  Let me know if that works.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 5
(3,074 Views)