Announcement

Collapse
No announcement yet.

Anyone know what is wrong with this scrpt.

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

    Anyone know what is wrong with this scrpt.

    Anyone spot what is wring with this script?
    Code:
    Sub Main
    dim A
    Dim  B
    dim C
    A="Landy has moved to $$DSR:1083:"
    C = Len(A)
    B = (left(A,C-31))
    hs.speak B
     End Sub
    thanks
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
    HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
    BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
    BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

    #2
    You cannot use replacement variables directly in scripts.

    This should work:

    PHP Code:
        Sub Main()
            
    Dim A
            Dim B
            Dim C
            A 
    "Landy has moved to " hs.ReplaceVariables("$$DSR:1083:")
            
    Len(A)
            
    = (Microsoft.VisualBasic.Left(A31))
            
    hs.speak(B)
        
    End Sub 
    Jon

    Comment


      #3
      Originally posted by jon00 View Post
      You cannot use replacement variables directly in scripts.

      This should work:

      PHP Code:
          Sub Main()
              
      Dim A
              Dim B
              Dim C
              A 
      "Landy has moved to " hs.ReplaceVariables("$$DSR:1083:")
              
      Len(A)
              
      = (Microsoft.VisualBasic.Left(A31))
              
      hs.speak(B)
          
      End Sub 
      Thanks Jon,

      another thing gone from HS2, unfortunately your suggestion errors,
      Running script, script run or compile error in file: C:/Program Files/HomeSeer HS3/scripts/Landy moved.txt424:Object required: 'Microsoft' in line 7 More info: Object required: 'Microsoft'
      sigpic
      A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
      HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
      BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
      BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

      Comment


        #4
        Sorry I forgot to remove that bit as you are running this in VBScript:

        B = (Microsoft.VisualBasic.Left(A, C - 31))

        becomes

        B = (Left(A, C - 31))
        Jon

        Comment


          #5
          Thanks Jon, works perfectly, lots of script editing to do now.

          Appreciate your help.
          sigpic
          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
          HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
          BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
          BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

          Comment

          Working...
          X