DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with "properties.exists" for CreateDataFileHeaderAccess in DIAdem 2014?

Solved!
Go to solution

I have the following script:

 

Dim oMyDataFileHeaderAccess, oMyDataStore
Set oMyDataFileHeaderAccess = CreateDataFileHeaderAccess
dim mypath : mypath = "C:\MyFile.tdms"
Set oMyDataStore = oMyDataFileHeaderAccess.Open(mypath ,"TDMS", True)

logfilewrite oMyDataStore.RootElements(1).Properties.Exists("MyProperty") ' returns FALSE
logfilewrite oMyDataStore.RootElements(1).Properties("MyProperty").value ' returns the expected value

 

The "Properties.Exists" feature doesn't return what I expect.  If I have a file where the root property "MyProperty" exists (and I can access the value!), the Properties.Exists("MyProperty") returns false 😞

 

Am I doing something wrong?  Thank you!

0 Kudos
Message 1 of 3
(3,008 Views)
Solution
Accepted by topic author JuliaDawkins

Hey Julia,

You have to set this property first before reading custom root properties 😉

oMyDataStore.RootElements(1).Properties.ListInstanceProperties = true

Same for group and channel properties

Regards

Christian
CLA, CTA, CLED
0 Kudos
Message 2 of 3
(2,966 Views)

Perfect, thank you!

0 Kudos
Message 3 of 3
(2,949 Views)