Hash

Prev Next Home Home Table Of Contents Index

Hash (String)

Hashing strings is a very fast way to find a string in a list of strings. It is much faster than a binary search. In MarxMenu, I've implemented hashing in a way that is very innovative. What I do is to associate a hashed string with a MarxMenu variable that is dynamically allocated. The string becomes the key to access the variable for either reading or writing.


Example:
Hash('AGE') = 21 Hash('HAIR') = 'Brown' Writeln Hash('AGE') ;returns 21 Writeln Hash('HAIR') ;returns 'Brown'

In the above example, a variable accessed by Hash('AGE') is created and set to the value 21. Like any other variable it can be read or overwritten with a new value. What is happening here is that we are giving MarxMenu variables a name, which is a string they can be accessed by for either read or write. This allow you to build applications that data and procedures can be accessed through their own vocabulary that you create.

See Also: HashDispose HashLevel HashLib

Category: HashVars

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home