[ASP]Bug in Dictionary object?

Pagina: 1
Acties:

  • mulder
  • Registratie: Augustus 2001
  • Laatst online: 08-05 11:55

mulder

ik spuug op het trottoir

Topicstarter
Het resultaat van dit stukkie script:
ASP.NET Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
    Dim testDictionary
    Dim testVar, dictKey
    
    Set testDictionary = Server.CreateObject("Scripting.Dictionary")
    Call testDictionary.Add("1", "1")
    Call testDictionary.Add("2", "2")
    Response.Write(testDictionary.Count & "<br />")
    testVar = testDictionary.Item(0)
    Response.Write(testDictionary.Count & "<br />")
    'For Each dictKey In testDictionary
        'Response.Write(dictKey & ":" & testDictionary.Item(dictKey) & "<br />")
    'Next

is:
2
3

Ben ik nou gek of is dit dus een dikke bug? Er word gewoon een item toegevoegd ipv een error te raisen.

oogjes open, snaveltjes dicht


  • abeker
  • Registratie: Mei 2002
  • Laatst online: 14:31

abeker

...

Dat is standaard gedrag van het Dictionary object. Zie Dictionary Item property

the less one forgets, the less one remembers


  • mulder
  • Registratie: Augustus 2001
  • Laatst online: 08-05 11:55

mulder

ik spuug op het trottoir

Topicstarter
:/ brilliant, is hier enige nut voor?

Behavior by design zekers... :O

oogjes open, snaveltjes dicht


  • pjonk
  • Registratie: November 2000
  • Laatst online: 29-12-2025
Voor wat jij wil hebben ze toch de Exists method uitgevonden?
http://msdn.microsoft.com...pt56/html/jsmthexists.asp

[ Voor 3% gewijzigd door pjonk op 20-04-2005 16:29 ]

It’s nice to be important but it’s more important to be nice


  • mulder
  • Registratie: Augustus 2001
  • Laatst online: 08-05 11:55

mulder

ik spuug op het trottoir

Topicstarter
Ik wil gewoon een error als ik iets fout doe ;)

oogjes open, snaveltjes dicht