To location: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
mNo edit summary
imported>Heeheehee
m This function doesn't really work with ints.
Line 14: Line 14:
parameter1={{Param|string|name}}|
parameter1={{Param|string|name}}|
p1desc={{Pspan|id}} is a location name to convert|
p1desc={{Pspan|id}} is a location name to convert|
}}|
function2={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
parameter1={{Param|int|id}}|
p1desc={{Pspan|id}} is a location ID # to convert|
}}|
}}|


Line 29: Line 20:
needscode=yes|
needscode=yes|


special=While direct casting via $location[ ] is case-insensitive and able to catch partial matches, this function has the added benefits of handling location ID #'s and passing variables as a string parameter.|
special=While direct casting via $location[ ] is case-insensitive and able to catch partial matches, this function has the added benefit of passing variables as a string parameter.|
}}
}}

Revision as of 04:28, 28 April 2010

needs(code_samples);

Function Syntax

location to_location(string name )

  • id is a location name to convert

Returns the location that matches name or id as specified.

Special

While direct casting via $location[ ] is case-insensitive and able to catch partial matches, this function has the added benefit of passing variables as a string parameter.