Announcement

Collapse
No announcement yet.

.Contains only triggers at value's not text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .Contains only triggers at value's not text

    SOLVED!!!

    Hi all ,

    sorry again for another question but i cant fix it , i searched all over the internet and forums for this issue ..


    I have this :
    Plates is a part of an array in a ini file so it reads the text i put in there
    ref2= a virtual device
    devp= the data i put in the ini when it match..

    Code:
    For Each devp As String In plates
    		Ref = hs.GetDeviceRef("ANPR-Plates")
    		Ref2 = hs.DeviceString(ReF)
    		hs.writelog("Virtual device value", ref2)
    		hs.writelog("Data in the ini", devp)
    		If ref2.Contains (devp) Then hs.speak ("Plates, ini file working")
    i get this output and that works ,

    Code:
    Aug-29 17:02:13	 	TTS	Speak ():Plates, ini file working
    Aug-29 17:02:13	 	Data in the ini	PT-FK-99
    Aug-29 17:02:13	 	Virtual device value	"PT-FK-99"




    This one hs the problem, this one checks an other ini file for a match and triggers also a voice event.
    so it compare's the output of the ref2 and matches it with another ini file at split arrSplitData2(0)

    Code:
    Ref = hs.GetDeviceRef("ANPR-Plates")
    		Ref2 = hs.DeviceString(ReF)
    		hs.writelog("Virtual device value", ref2)
    		hs.writelog("Data in Compare", arrSplitData2(0))
    		If arrSplitData2(0).ToLower.Contains (ref2) then hs.speak (" TIme, Match found in compare File") '<
    I get this result , it reads ok it should trigger but it doesnt...
    the data is fine.. even if i use the capitals nothing triggers , but if its a value it triggers normal...

    Code:
    Aug-29 17:02:13	 	Data in Compare	pt-fk-99
    Aug-29 17:02:13	 	Virtual device value	"PT-FK-99"



    Now if i let it read a virtual device with a value in it like a time value it works :


    Code:
    Ref = hs.GetDeviceRef("ANPR-Time")
    		Ref2 = hs.DeviceString(ReF)
    		hs.writelog("Virtual device value", ref2)
    		hs.writelog("Data in Compare", arrSplitData2(1))
    		If arrSplitData2(1).ToLower.Contains (ref2) then
    		 hs.speak (" TIme, Match found in compare File") '<--- this line is the compare line ref2=the virtual arrsplitdata2 = path4
    		end if



    Code:
    Aug-29 17:22:22	 	TTS	Speak ():TIme, Match found in compare File
    Aug-29 17:22:22	 	Data in Compare	02:44
    Aug-29 17:22:22	 	Virtual device value	02:44



    regards
    Last edited by Malosa; August 31st, 2016, 11:09 AM. Reason: SOlved
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.
Working...
X