Infinity wrote on Aug 16
th, 2006 at 4:53pm:
Sounds perfect, but I have no experiemce with Global Values and the book is frustrating.
GlobalValues are really very simple. They are a way to store a data using a tag. The tag is used to retrieve the data.
GlobalValue("MyName", "Mark")
Will store the string "Mark" under the tag "MyName". If I want to find out what is stored under "MyName":
var aa as string
aa = @GlobalValue("MyName")
That's pretty much all there is to it. They are stored inside your application file, so they don't go away at the end of your session.
To lookup, lets say a zip code lookup by city and state, first store it:
var aa as string
aa = CityName + "|" + StateName
GlobalValue(aa, ZipCode)
And then look it up:
var aa as string
var MyZipResult as string
aa = CityName + "|" + StateName
MyZipResult = @GlobalValue(aa)
Usually a table of GlobalValues would be created once, often using a mass update. Then the normal event code would look things up.