Determines whether or not a key exists in an SRP Hash Table.
Syntax
Result = SRP_HashTable("Contains", Handle, Key)
Returns
1 if the key exists within the SRP Hash Table or 0 if it does not.
Parameters
Parameter | Description |
---|---|
Handle | Handle to an existing SRP Hash Table (REQUIRED) |
Key | The key to evaluate in the SRP Hash Table (REQUIRED) |
Remarks
The Contains service determines if the key exists in the hash table. This is particularly useful if your keys might map to empty values since an empty value is also returned when a key doesn't exist.
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") // This will return 1 Exists = SRP_HashTable("Contains", Handle, "SRP") // This will return 0 Exists = SRP_HashTable("Contains", Handle, "Microsoft") // Clean up SRP_HashTable("Release", Handle)