Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Loop

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,54113
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Loop
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Loop - 12/9/2007 6:56:54 PM   
  dreamzor

 

Posts: 1
Score: 0
Joined: 12/9/2007
Status: offline
Hello.

I got a ASP page where I got this code.

Set d = CreateObject("Scripting.Dictionary")
   d.removeall
   d.CompareMode = 0

  For Each x In tmpArray
       If d.Exists(x) Then
           Response.Write "<br> " & x & " Exists"
          
           
       else
       Response.Write "<br>Adding" & x
           d.Add x, x
         
       end if       
      
   Next

The ForEach checks to se if the emailadress allready exists in the array, if it does do nothing and if it doesnt, add it to the dictonary.

tmpArray contains email adresses that are coma seperated, all that works fine. but when I run this the 2 first adresses allways get added to the dictonary.

anyone got a clue what Im doing wrong?
 
 
Post #: 1
 
 RE: Loop - 12/10/2007 3:12:43 AM   
  webber123456

 

Posts: 39
Score: 0
Joined: 9/20/2007
Status: offline
debug with response.write statements to see what values are being compared and if they match

(in reply to dreamzor)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Loop Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts