Announcement

Collapse
No announcement yet.

Scripting question

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

    Scripting question

    Can someone tell me what's wrong with this script to get the number of entries in the address book?


    sub main()
    dim adr_count
    adr_count=hsp.ADRCount

    hs.writelog adr_count

    end sub


    I get the following error


    1/16/2008 10:43:24 PM - Error - Running script, script run or compile error in file: test1.txt0: in line 0 More info: Missing parameter does not have a default value.Parameter name: parameters
    jjsmd@yahoo.com

    #2
    Originally posted by jjsmd View Post
    Can someone tell me what's wrong with this script to get the number of entries in the address book?


    sub main()
    dim adr_count
    adr_count=hsp.ADRCount

    hs.writelog adr_count

    end sub


    I get the following error


    1/16/2008 10:43:24 PM - Error - Running script, script run or compile error in file: test1.txt0: in line 0 More info: Missing parameter does not have a default value.Parameter name: parameters
    Try
    sub main()
    dim adr_count
    adr_count=hsp.ADRCount

    hs.writelog "info", adr_count

    end sub
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Thanks Rupp, as usual you were right on.
      jjsmd@yahoo.com

      Comment


        #4
        Rupp if youre still in a generous mood, why does the following say

        1/16/2008 11:35:26 PM - Error - Running script, script run or compile error in file: deleteunavailable.txt1024:Expected statement in line 16 More info: Expected statement


        Sub Main()
        dim i, line, adr_count, contact
        dim callname, callnmbr, dhit, addbk

        adr_count=hsp.ADRCount

        hs.writelog "info",adr_count
        for i = 1 to adr_count
        set contact = hsp.ADRGet(i)
        callname = contact.first&" "&contact.last
        if callname="UNAVAILABLE" then hsp.ADRDelete(i)
        hs.writelog "info",i,callname
        end if
        next

        end sub
        jjsmd@yahoo.com

        Comment


          #5
          Originally posted by jjsmd View Post
          Rupp if youre still in a generous mood, why does the following say

          1/16/2008 11:35:26 PM - Error - Running script, script run or compile error in file: deleteunavailable.txt1024:Expected statement in line 16 More info: Expected statement


          Sub Main()
          dim i, line, adr_count, contact
          dim callname, callnmbr, dhit, addbk

          adr_count=hsp.ADRCount

          hs.writelog "info",adr_count
          for i = 1 to adr_count
          set contact = hsp.ADRGet(i)
          callname = contact.first&" "&contact.last
          if callname="UNAVAILABLE" then hsp.ADRDelete(i)
          hs.writelog "info",i,callname
          end if
          next

          end sub
          Try: contact.first & " " & contact.last

          tenholde
          tenholde

          Comment


            #6
            I thought that's what I have
            jjsmd@yahoo.com

            Comment


              #7
              Hum... The writelog statement only takes 2 arguments so try
              hs.writelog "info",i & " " & callname
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #8
                Originally posted by jjsmd View Post
                I thought that's what I have
                In vb.net the concatenation operator ("&") must be preceeded and followed with spaces; that's what I was pointing out. May not be the case with .txt scripts.


                The other problem is the writelog statement with 3 parameters.

                tenholde
                tenholde

                Comment


                  #9
                  Thanks to both of you for your help.

                  I think I've got it now.
                  jjsmd@yahoo.com

                  Comment

                  Working...
                  X