Get the value paired with a given key in an SRP Hash Table.
Syntax
Value = SRP_HashTable("Get", Handle, Key)
Returns
The value at the given key, "" otherwise.
Parameters
Parameter | Description |
---|---|
Handle | Handle to an existing SRP Hash Table (REQUIRED) |
Key | The key whose value to get (REQUIRED) |
Remarks
The Get service returns the value paired to the given key. If the hash table doesn't recognize the key, "" is returned. However, it is possible to have an empty value paired with a key. You can determine that "" is the result of a missing key using the Contains service.
Examples
// Create a case-insensitive hash table Handle = SRP_HashTable("Create") // Add some entries SRP_HashTable("Set", Handle, "Amazon", "http://www.amazon.com") SRP_HashTable("Set", Handle, "Google", "http://www.google.com") SRP_HashTable("Set", Handle, "Revelation", "http://www.revelation.com") SRP_HashTable("Set", Handle, "SRP", "http://www.srpcs.com") SRP_HashTable("Set", Handle, "Yahoo", "http://www.yahoo.com") SRP_HashTable("Set", Handle, "Empty", "") // This will return "http://www.srpcs.com" Value = SRP_HashTable("Get", Handle, "SRP") // This will return "" because the key does not exist (Exists will be 0) Value = SRP_HashTable("Get", Handle, "Foo") Exists = SRP_HashTable("Contains", Handle, "Foo") // This will return "" because that is the value we stored (Exists will be 1) Value = SRP_HashTable("Get", Handle, "Empty") Exists = SRP_HashTable("Contains", Handle, "Empty") // Clean up SRP_HashTable("Release", Handle)