Difference between revisions of "To url"
Jump to navigation
Jump to search
imported>StDoodle m (moved Location to url to To url) |
imported>Eliteofdelete |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{ | ||
#vardefine:name|to_url}}{{ | #vardefine:name|to_url}}{{ | ||
− | #vardefine:return_type| | + | #vardefine:return_type|string}}{{ |
− | |||
− | |||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
− | |||
function1={{Function| | function1={{Function| | ||
Line 14: | Line 11: | ||
return_type={{#var:return_type}}| | return_type={{#var:return_type}}| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
− | parameter1={{Param| | + | parameter1={{Param|location|place}}| |
− | + | p1desc={{Pspan|place}} is an in-game location to parse| | |
− | p1desc={{Pspan|}} | ||
− | |||
}}| | }}| | ||
− | function_description=| | + | function_description=Returns the short url (normally of the form "adventure.php?snarfblat=") used to visit the location {{pspan|place}}.| |
− | + | code1={{CodeSample| | |
+ | title=Code Samples| | ||
+ | description=Following example shows basic to_url operations.|| | ||
+ | code= | ||
+ | <syntaxhighlight> | ||
+ | location first; | ||
+ | first = $location[The Poop Deck]; | ||
+ | print(first+" gives "+to_url(first)+".", "blue"); | ||
+ | </syntaxhighlight>| | ||
+ | moreinfo= | ||
+ | It gives the following output. | ||
+ | <pre> | ||
+ | The Poop Deck gives adventure.php?snarfblat=159. | ||
+ | </pre> | ||
+ | }}| | ||
− | see_also={{SeeAlso|}} | + | see_also={{SeeAlso|visit_url}}| |
− | + | special=Trying to use $location[none] will generate an "Unexpected error."| | |
− | |||
− | special= | | ||
}} | }} | ||
+ | |||
+ | [[Category:String Handling Routines]] |
Latest revision as of 15:42, 26 January 2015
Function Syntax
string to_url(location place )
- place is an in-game location to parse
Returns the short url (normally of the form "adventure.php?snarfblat=") used to visit the location place.
Code Samples
Following example shows basic to_url operations.
location first;
first = $location[The Poop Deck];
print(first+" gives "+to_url(first)+".", "blue");
It gives the following output.
The Poop Deck gives adventure.php?snarfblat=159.
See Also
Special
Trying to use $location[none] will generate an "Unexpected error."