GET
Parameters
Order | Name | Type | Desc |
---|---|---|---|
1 | name | const | The name of the variable to retrieve |
Returns
Any item stored with SET.
Description
This command is used to retrieve a stack item that was saved with SET or PUT and place it on top of the stack.
Using GET, SET and PUT can give significant performance improvements, as no repeated, expensive tasks (such as database searches etc.) need to be performed.
When this command is used in the function passed to EACH, the search cascades - it will not only search for those items that were inside the EACH function, but also inside any scope. This search is carried out in-order, so if you have conflicting variable names, the one 'closest' will be chosen.
Example
A simple example of PUT and GET being used.
'TE101' ASSET 'asset' PUT 'Temperature' PROPERTY POINTS 'asset' GET 'Serial Number' PROPERTY POINTS APPEND
This is a simple example - there are much more efficient ways of doing this particular job!
In this example, we are looking for the temperature and the serial number of TE101 (and we are going about it the hard way).
- First, we find asset TE101 (ASSET)
- We save that asset as 'asset' so we can use it later. (PUT)
- We find the property called 'Temperature' (PROPERTY)
- We then locate every valid use of 'Temperature' on that asset. (POINTS)
- We retrieve the 'asset' TE101 from memory. (GET)
- We find the property called 'Serial Number' (PROPERTY)
- We then locate every valid use of 'Serial Number' on that asset. (POINTS)
- We join both lists together. (APPEND)