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.
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.