Re: Question about feature
- Posted by mattlewis (admin) May 18, 2012
- 1297 views
I'm new to Euphoria, and so far am happy with all that I see, but there's one thing that I haven't seen a way to do, related to hashes.
Suppose I know that Zake Zyzzky has a personnel number of ZZ9PZA.
How would I store this information such that later on, when all I know is a personnel number, and I have ZZ9PZA, that the person is Zake?
The simplest thing, for in memory storage, is to use a map. Those can also be serialized to disk, or you might want to use something like an EDS database.
Alternatively, you could use two sequences, one that holds the number, and another with other data, where the id number is always at the same index as the other data, and then use find() on the id sequence to get the element number where that user is stored.
If you had more detail about what you were going to do, it would be easier to give more detailed suggestions.
Matt