NAMN

NAMN is a CAOS command which allows the user to loop over all named local variables of the target agent.

Usage
Syntax: NAMN PREVIOUS (variable)

This returns the name of the NAME variable of the agent. PREVIOUS is the name of the previous variable, to get the first NAME variable set it to "". After having looped over all the NAME variables, it will return an empty string "".

Examples
If you target an agent, this piece of code will return the name and value of the named variables. sets va00 "" loop namn va00 outs va00 doif va00 ne "" outs " - " outs name va00 outs " \n" endi untl va00 eq ""

Bugs
If you attempt to check the value of a NAME variable named an empty string (""), the NAMN command will not work anymore on this agent. Examples: sets name "" "abc" doif name "" eq 0 endi outv type name ""
 * Do NOT use this, as it disables the use of NAMN on this agent
 * Do NOT use this, as it disables the use of NAMN on this agent
 * Do NOT use this, as it disables the use of NAMN on this agent

So if you want to enable the use NAMN on the target agent, make sure to check that the name of the returned NAME variable isn't an empty string ("") before trying to manipulate it. Do not set the NAME "" variable either.