Announcement

Collapse
No announcement yet.

Help with "Object required" error

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

  • Help with "Object required" error

    After looking at other scripts, I can't figure out why I'm getting this error:
    CID_TEST.txt424:Object required 'contact' in line 18



    in this code:






    PHP Code:
    Sub main()
        
    Dim cid_namecid_number
        Dim adr_count
        Dim contact
        Dim i
     
        cid_name 
    hsp.CIDName(1)
        
    cid_number hsp.CIDNumber(1)
     
        
    hs.Writelog "CID_Test"cid_name ": " cid_number
     
        adr_count 
    hsp.ADRCount
     
        hs
    .writelog "CID_Test""ADRCount is " adr_count
     
        
    For 0 To adr_count
            Set contact 
    hsp.ADRGet(i)
            
    hs.writelog "CID_Test""contact is " contact.cid_name
        Next
     
    End Sub 

  • #2
    Contacts start at 1 not zero, so replace:
    For i = 0 To adr_count
    with
    For i = 1 To adr_count

    Give that a go.

    Ross.

    Comment


    • #3
      Wow. I've been developing two projects at work that require a bunch of 'For' loops on zero based arrays. I come home and can't get that zero out of my head!

      Thanks for the extra set of eyes!

      Comment

      Working...
      X