DICTADD

Top  Previous  Next

Syntax

INT = DictAdd(dict as POINTER,key as STRING,value as STRING),

Description

Adds or replaces a key-value association..

Parameters

dict - Pointer to an associative array created with the DICTCREATE command.

key - The key string.

value - The string value.

Return value

TRUE on success, FALSE otherwise..

Remarks

If the associated element already exists then the value is replaced.

Example usage

mydict = DictCreate(100)
 
DictAdd(mydict,"John","Red")
DictAdd(mydict,"Joe","Green")
DictAdd(mydict,"Sue","Yellow")
DictAdd(mydict,"Phil","Purple")
DictAdd(mydict,"Jerry","Orange")
DictAdd(mydict,"Lisa","Blue")
DictAdd(mydict,"Tammy","Black")
DictAdd(mydict,"George","white")
DictAdd(mydict,"Paul","Indigo")
DictAdd(mydict,"Merideth Abigal","Violet")