The [map->insert] inserts a value into the map for a specified key. Accepts a single name/value parameter which is the name of a key in the array and the value that should be stored for that key. If desired a single value may be passed as a parameter to the method. In this case the value will be treated as a key with an empty value, essentially acting as a placeholder in the map.
Keys and values can be of any data types.
Note: This method will replace an item in the map with the same key. Each map can only store one value for each key.
map->insert( key = value )
map->insert( placeholder_key )
Use the [map->Insert] method.
The following example:
Code
var (colours = map( 'red'='#ff0000',
'green' = '#00ff00',
'blue' = '#0000ff',
'grey' = '#aaaaaa') )
$colours->insert( 'black' = '#000000' )
$colours->insert( 'magenta' )
$colours->insert( 'grey' = '#ababab' )
$colours
Result
map(black = #000000, blue = #0000ff, green = #00ff00, grey = #ababab, magenta = , red = #ff0000)
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments