From Kolmafia
(Difference between pages)
Jump to navigation
Jump to search
imported>Eliteofdelete |
|
Line 1: |
Line 1: |
− | {{
| + | Script Manager |
− | #vardefine:name|to_stat}}{{
| |
− | #vardefine:return_type|stat}}{{
| |
− | | |
− | FunctionPage|
| |
− | name={{#var:name}}|
| |
− | | |
− | function1={{Function|
| |
− | name={{#var:name}}|
| |
− | aggregate={{#var:aggregate}}|
| |
− | return_type={{#var:return_type}}|
| |
− | return_also={{#var:return_also}}|
| |
− | parameter1={{Param|string|convert}}|
| |
− | }}|
| |
− | | |
− | function_description=When supplied a string, returns the stat that corresponds to the specified parameter {{pspan|convert}}.|
| |
− | | |
− | code1={{CodeSample|
| |
− | title=Code Samples|
| |
− | description=Following example shows basic to_stat operations.||
| |
− | code=
| |
− | <syntaxhighlight>
| |
− | string first, second, third;
| |
− | | |
− | first = "mox";
| |
− | second = "moxie";
| |
− | third = "MuSclE";
| |
− | | |
− | print(first+" gives "+to_stat(first)+".", "blue");
| |
− | print(second+" gives "+to_stat(second)+".", "blue");
| |
− | print(third+" gives "+to_stat(third)+".", "blue");
| |
− | </syntaxhighlight>|
| |
− | moreinfo=
| |
− | It gives the following output.
| |
− | <pre>
| |
− | mox gives none.
| |
− | moxie gives Moxie.
| |
− | MuSclE gives Muscle.
| |
− | </pre>
| |
− | }}|
| |
− | | |
− | see_also={{SeeAlso|to_item|to_skill|to_monster}}|
| |
− | | |
− | special=If no match is found for {{pspan|convert}}, this function returns $stat[ none ].|
| |
− | }}
| |
− | | |
− | [[Category:Datatype Conversions]]
| |
Latest revision as of 23:55, 9 November 2020