To location

From Kolmafia
Revision as of 22:59, 13 March 2010 by imported>StDoodle (Created page with '{{ #vardefine:name|to_location}}{{ #vardefine:return_type|location}}{{ FunctionPage| name={{#var:name}}| function_category=Datatype Conversions| function1={{Function| name={{#v…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
needs(code_samples);

Function Syntax

location to_location(string name )

  • id is a location name to convert

location to_location(int id )

  • id is a location ID # to convert

Returns the location that matches name or id as specified. Plural names will not match unless the third form is used and qty is not equal to 1.

Special

Unlike direct casting via $item[ ], no match found by this function will return $item[ none ] rather than abort.