JSL Syntax Reference > JSL Messages > Associative Arrays
发布日期: 04/13/2021

Associative Arrays

For the following messages, map stands for an associative array or a reference to one.

map<<First

Returns the first key within map, or Empty() if map has no keys. Note that keys are returned in lexicographical order.

map<<Get Contents

Returns a list of all key-value pairs within map.

map<<Get Keys

Returns a list of all the keys within map.

map<<Get Default Value()

Returns the implicit value of all absent keys, or Empty() if none has been set.

map<<Get Value(key)

Returns the value for the key within map.

map<<Get Values(<{keyList}>)

If no argument is provided, a list of all values within map is returned.

If a list of keys is provided, a list of the values corresponding to only those keys is returned.

map<<Insert(key, value)

Inserts the key into map and assigns value to it. If key already exists in map, its value is replaced by the new value given. This message is equivalent to the function Insert Into.

map<<Next(key)

Returns the key following the given key within the map, or Empty() if map has no keys. Note that keys are returned in lexicographical order.

map<<Remove(key)

Removes the key and value from map. This message is equivalent to the function Remove From.

map<<Set Default Value(v)

Sets the implicit value of all absent keys. Any key added without a value is assigned this value by default.

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).