Click to See Complete Forum and Search --> : Gimme a hash !


Jenda
September 22nd, 2001, 08:45 AM
How do you say HASH in VB?

I need an object that would allow something like

Obj("foo") = "Hello world"
If not isEmpty(Obj("foo")) then MsgBox obj("foo")




The index will always be a string, the value will be either number or a string (I don't mind if the number gets converted to a string.)

I need the Obj("foo") = "something"

to work correctly no matter whether the Obj("foo") was set to anything previously and I need the var = Obj("foo")

to return
either Empty or "", but again NOT to bomb out when the Obj("foo") was not set.

Thanks, Jenda

P.S.: I tried the "Collection" class. It's less than useless.

dcaillouet
September 22nd, 2001, 01:36 PM
If I understand your post correctly, you're looking for the Dictionary object in the Scripting Runtime. You could probably find some classes that do similar things:

http://msdn.microsoft.com/scripting/vbscript/doc/vsobjDictionary.htm
http://msdn.microsoft.com/scripting/vbscript/doc/vsproitem.htm

http://www.planet-source-code.com/xq/ASP/txtCodeId.25595/lngWid.1/qx/vb/scripts/ShowCode.htm

Jenda
September 22nd, 2001, 04:30 PM
Great. Yes this was exactly what I was looking for. :-)

It's hard to find the right object in those myriads. And its outright impossible to find anything in MSDN.

Thanks a lot :-)

Jenda