Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMapStringToString equivalent in VB

Status
Not open for further replies.

TheMillionDollarMan

Programmer
Jun 10, 2002
132
US

Hi.
I am a C++, VB coding cowboy. Yeehaa.

I use the CMapStringToString class in C to read in a text file of values. The text file looks something like:

LookupValue1, ReturnValue1
LookupValue2, ReturnValue2
US, United States
JP, Japan
etc...

Once its read in I can use it later to look up codes etc. Eg If I have Country Code = US and I want United States Of America I pass in "US" to my map object and that returns me the full name.

Does VB have a hash map like this?
I want to avoid another trip to the database just to look up the country name.

I know Java and C++ do...

Thanks
Dave
 
VB does not make use of maps unfortunately. You should be able to do what you are looking to do with either a 'Collection' or 'Dictionary' object though. Both of these objects are covered in MSDN as well as in a number of post on this forum. If you have questions just repost to this forum. Good Luck.

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top