Creates an SRP Hash Table.

Syntax

Handle = SRP_HashTable("Create", CaseSensitiveFlag, ApproximateCount)

Returns

A handle to a new SRP List.

Parameters

ParameterDescription
CaseSensitiveFlagDetermines whether or not the hash table keys are case sensitive. (OPTIONAL)
ApproximateCountThe estimated number of elements the hash table will contain (OPTIONAL)

Remarks

The Create service creates a new SRP Hash Table. A SRP Hash Table is an in-memory hash table that stores key-value pairs. Just like OpenInsight tables store records identified by unique keys, SRP Hash Tables store variables identified by unique keys.

OpenInsight tables always use case-sensitive keys. However, you can decide whether or not SRP Hash Tables use case-sensitive or case-insensitive keys using the CaseSensitiveFlag parameter. Setting it to 1 makes the hash table case-sensitive whereas 0 makes it case-insensitive. Omitting this parameter is the same as setting it to 0.

The ApproximateCount parameter is useful for optimizing large hash tables. In most cases, you can omit this parameter. However, if you expect to have 10,000 or more entries, then setting this is recommended. You don't have to provide an accurate count and it doesn't hurt to pass a value larger than what you expect. Setting this parameter pre-allocates memory and optimizes the hashing algorithm accordingly.

Examples

// Create a case-insensitive hash table
Handle1 = SRP_HashTable("Create")

// Create a case-sensitive hash table
Handle2 = SRP_HashTable("Create", 1)

// Create a case-sensitive hash table that will contain roughly 250,000 elements
Handle3 = SRP_HashTable("Create", 1, 250000)
 
// When we're done, be sure to clean up
SRP_HashTable("Release", Handle1:@FM:Handle2:@FM:Handle3)
  • No labels