Difference between revisions of "Set property"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
(Created page with '{{ #vardefine:name|set_property}}{{ #vardefine:return_type|void}}{{ FunctionPage| name={{#var:name}}| function_category=Miscellaneous| function1={{Function| name={{#var:name}}|…')
 
imported>Bale
m
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Miscellaneous|
 
  
 
function1={{Function|
 
function1={{Function|
Line 26: Line 25:
 
special=You can set a custom property that automatically gets its value cleared each new KoL day by prefixing it with an underscore.|
 
special=You can set a custom property that automatically gets its value cleared each new KoL day by prefixing it with an underscore.|
 
}}
 
}}
 +
 +
[[Category:Miscellaneous Functions]]

Revision as of 05:31, 22 May 2010

needs(code_samples);

Function Syntax

void set_property(string prop ,string value )

  • prop is the property to set
  • value is the value to set the property to

Looks for a global or appropriate user preference from the saved files (found in your "Settings" directory) and if it finds one that matches, it overrides its value with value. If a match is not found in your existing preferences for prop, it will create a property with that name and set it to value.

CLI Equivalent

The CLI command "set" works similarly.

See Also

get_property()

Special

You can set a custom property that automatically gets its value cleared each new KoL day by prefixing it with an underscore.