Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
aql:setmap [2020/01/18 06:35] optrix created |
aql:setmap [2020/01/18 06:39] (current) optrix |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====SETMAP==== | + | ====INDEX==== |
| ===Parameters=== | ===Parameters=== | ||
| ^Order^Name^Type^Desc^ | ^Order^Name^Type^Desc^ | ||
| - | |1|original|[[map|map]]|The map to be filtered| | + | |1|array|any|The multi-valued item (ie. map or array) to be searched| |
| - | |2|key|[[const|const]]|The name of the map item to be searched for| | + | |2|key|[[const|const]]|The index number in the array| |
| - | |3|value|[[const|const]]|The value of the map item to allow| | + | |
| ===Returns=== | ===Returns=== | ||
| - | Places an [[map|map]] on the stack. | + | Places an item of the same type as //array// onto the stack. |
| ===Description=== | ===Description=== | ||
| - | This function adds elements to the map (//original//). | + | This function is used to extract the //nth// item from any list of items. |
| - | If the given //key// doesn't exist, it is created. If it already exists, the value is overwritten. | + | For example, if you had an [[asset list|asset list]] on the stack containing ('TE101','TE201' and 'TE301') and used the following command... |
| - | This command is often used with functions such as [[fGETTABLE]] or [[fGETHISTORY[[ to create the options map. | + | **0 INDEX** |
| - | For example, if you had the following map on the stack... | + | ...you would end up with an asset list containing only //one// item - TE101. |
| - | + | ||
| - | [ { "name": "alpha", | + | |
| - | "colour": "orange"}, | + | |
| - | { "name": "beta", | + | |
| - | "colour":"blue"} ] | + | |
| - | + | ||
| - | ...then the command **'colour' 'blue' ADDMAP** will set the colour to "blue" for //all// of the items in the map. | + | |
| ===See Also=== | ===See Also=== | ||
| - | [[fFILTERMAP]] | + | [[fCOUNT]] |