NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
jxjimmy
Posts: 14
0 Kudos
Accepted Solution

Traverse Variables in FileGlobals

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
Active Participant
~jiggawax~
Posts: 1,028
0 Kudos

Re: Traverse Variables in FileGlobals

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
Test Development Engineer
L-3 Communications
Active Participant
~jiggawax~
Posts: 1,028
0 Kudos

Re: Traverse Variables in FileGlobals

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

jigg
Test Development Engineer
L-3 Communications
Member
jxjimmy
Posts: 14
0 Kudos

Re: Traverse Variables in FileGlobals

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

- Jimmy
Active Participant
~jiggawax~
Posts: 1,028
0 Kudos

Re: Traverse Variables in FileGlobals

Here you go.  Let me know if that works.

jigg
Test Development Engineer
L-3 Communications
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page