Welcome to the Creatures Wiki! Log in and join the community.

NAMN

From Creatures Wiki
Revision as of 18:51, 30 March 2018 by Pilla (talk | contribs) (NAMN CAOS command with an example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 ""


See also

External links