03-25-2019 02:36 PM
Hi,
This is my first time using DIADEM and VB scripting, apologies in advance, if my question does not make more sense. In the below line of code, i am looking for "If The Definition channel is present or not "
If CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_").Properties("Unique_Definition").Value>0 Then
but, its throwing the error saying: Object required :'CNO(...)'
for your reference the above variables hold this values :
GroupTxt 1,
TempEmisType - emissions
TempChnStr-stream
And when i am using the old code, which i need to do certain modifications but majority of syntax is same, its still working, old code is:
If CNo(GroupTxt & "Ad_"& TempEmisType & TempChnStr & "DefinitionUnique_")>0
Any help is highly appreciated.
Thanks in Advance
Solved! Go to Solution.
03-26-2019 09:12 AM - edited 03-26-2019 09:13 AM
The upper code does not work because CNO(...) returns a numeric value back and not a group or a channel so
.Properties("Unique_Definition").Value
on a numeric will not work. However, you can use the numeric you get back from CNO(...) to get the group and the use ".properties" on it. Try:
If Data.Root.ChannelGroups(CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_")).Properties("Unique_Definition").Value>0 Then
http://zone.ni.com/reference/en-XX/help/370858M-01/functions/functions/cno/
03-26-2019 10:11 AM
Thank you @gsklyr, will try it.