Difference between revisions of "To location"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
m
imported>Eliteofdelete
Line 11: Line 11:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
parameter1={{Param|string|name}}|
+
parameter1={{Param|int|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|string|convert}}|
 +
p1desc={{Pspan|convert}} is the int or string to convert|
 
}}|
 
}}|
  

Revision as of 13:01, 26 January 2015

needs(code_samples);

Function Syntax

location to_location(int convert )

location to_location(string convert )

  • convert is the int or string 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.