Difference between revisions of "To location"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>StDoodle
m
Line 29: Line 29:
 
needscode=yes|
 
needscode=yes|
  
special=While direct casting via $location[ ] is case-insensitive and able to catch partial matches, this function has added benefit 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 benefits of handling location ID #'s and passing variables as a string parameter.|
 
}}
 
}}

Revision as of 23:06, 13 March 2010

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.

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.