×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    9

    Another Contacts problem

    Not so much a problem but..

    I was wondering how to show all my contacts using this code:
    Code:
    db = contacts.open()
    names = []
    numbers = []
    for i in db:
      names.append(db[i].title)
      num = db[i].find('mobile_number')
      if num:
        numbers.append(num[0].value) #First mobile
      else:
        numbers.append(None)
    
    names.sort()  #Sorts the list of names alphabetically
    i = appuifw.selection_list(names)
    But exclude contacts with a certain mobile number.

    Is this possible?

    Thanks, Aden.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Another Contacts problem

    To do that, only add the contact to the list if its number is different from the one you want to exclude:
    Code:
    db = contacts.open()
    names = []
    numbers = []
    for i in db:
      num = db[i].find('mobile_number')
      if (num) and (num<>the_number_goes_here):
        names.append(db[i].title)
        numbers.append(num[0].value) #First mobile
      else:
        numbers.append(None)
    
    names.sort()  #Sorts the list of names alphabetically
    i = appuifw.selection_list(names)

Similar Threads

  1. Replies: 1
    Last Post: 2005-12-04, 12:01
  2. problem with SelectionIndexes()
    By yencruz in forum Symbian
    Replies: 1
    Last Post: 2004-08-27, 16:17
  3. 7650 sync problem with outlook
    By rpvisser in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-05-09, 12:39
  4. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36
  5. 9210i: problem to syncronize Outlook 2002 contacts.
    By al02052 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-09-27, 08:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×