09-03-2012 05:35 AM
Hello, everyone!
I'm trying to run this script with the attached timechannels. Idea behind ´the script is very basic: just message three times a "100" - 100 being the line in which chnfind() should get the next bigger value after line 99
but - it won't work!
dim i for i = 1 to groupcount msgbox myLineNo(i) next function myLineNo(i) R1 = chv(99,cnoxget(i,1)) myLineNo = chnfind("ch(""["& i &"]/RecordTimestamp"") >"& str(R1,"d.dddd")) end function
thx for all help!
bamboocopter
Solved! Go to Solution.
09-03-2012 06:24 AM
Hi bamboocopter,
The problem is the string to value (and vice versa) converting in VBS. In DIAdem the date/time channel counts the seconds since the year 0. That means that there are just a view digits for the fractions of seconds. So if we can prevent the converting the channel find function will work fine.
a) chd and chdx are DIAdem function running direct on the values. Chv is using vbs (advantage: works with numeric and string)
b) R1 is a hard coded variable which can be integrated in the ChnFind function string.
The following works fine
dim i for i = 1 to groupcount msgbox myLineNo(i) next function myLineNo(i) R1 = chd(99,cnoxget(i,1)) myLineNo = chnfind("ch(""["& i &"]/RecordTimestamp"") > r1") end function
Greetings
Walter
09-03-2012 07:06 AM
Great!
Thanks a lot for your help and explanation!
makes life a lot easier....: