This is an old revision of the document!


Script Execution Example Page 2

After the last page, our stack and code looked like this…

StackCode
TE101 [Constant]ASSET [Command]

Now, it's time to copy the next line from code to the stack.

However, this time it's a command - rather than these being copied directly onto the stack, it's executed instead.

A command will almost always 'eat' one or more parameters off the stack. In this case, the ASSET command will eat a single item from the stack - the name of the asset it needs to search for.

StackCode
Running: ASSET ( TE101 )

A command may optionally add items to the stack as well. In this case, it will leave an Asset List on the stack, containing a single asset with the best matching name.

StackCode
AssetList [ { id: 203, name: “Temperature Sensor #1”, ern: “TE101” } ]

And now our script has reached its end. As a result, we have the name, ern and ARDI ID of the asset Temperature Sensor #1, which has ERN number TE101.