How do I create a word dictionary look-up array

donphillipe
10-06-2009, 04:53 PM
I am looking for a way to set up a word/definition look-up array in VB Classic 6. I want something like this:

Dim myvar () as string

myvar("water") = "wet"

Dim land as string

land = "desert"

myvar(land) = "dry"

msgbox myvar("desert") <this would post a messagebox "dry">
msgbox myvar("water") <this would post a messagebox "wet">


Dim tmpvar as string

tmpvar = "desert"

msgbox myvar(tmpvar) <(would post a messageBox "dry")>

tmpvar = "water"

msgbox myvar(tmpvar) <(would post a messageBox "wet")>


Is this possible in VB 6 Classic?


============================================
I coded years ago in IBM Rexx. With that you could create a stemmed array,
i.e.:

<set up our variable array>


tempvar = "chocolate"
var.tempvar = "sweet"

tempvar = "water"
var.tempvar = "wet"

tempvar = "desert"
var.tempvar = "dry"

<write to console a question and pull into a variable the keyboard input>

Say "Enter the element you want to know about:"
Pull tempvar .

Say var.tempvar


Above this routine would respond to the word "desert" with "dry:, "water" with "wet", etc.

Qua
10-06-2009, 06:40 PM
I'm not expert in VB6 by a long shot, but I don't believe that VB6 comes with any built-in hash tabel data structures. Either you will have to find a 3rd party hash tabel module or you can write one yourself.

Here's a link to a hash tabel module (http://www.devx.com/vb2themax/Tip/19307) written in VB6.

Rockoon
10-07-2009, 12:48 AM
http://support.microsoft.com/kb/187234

donphillipe
10-08-2009, 01:41 AM
Exactly what I needed; perfect!!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum